// Copyright (c) 2018, Miquel Martí <miquelmarti111@gmail.com>
// See LICENSE for licensing information

package cat.mvmike.minimalcalendarwidget.service.enums;

// https://unicode-table.com
public enum Symbol {

    MINIMAL(1.2f, "· ∶ ∴ ∷ ◇ ◈"),

    VERTICAL(1.2f, "· ∶ ⁝ ⁞ |"),

    CIRCLES(1.2f, "◔ ◑ ◕ ● ๑"),

    NUMBERS(0.8f, "1 2 3 4 5 6 7 8 9 +"),

    ROMAN(0.8f, "Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ ∾"),

    BINARY(1f, "☱ ☲ ☳ ☴ ☵ ☶ ☷ ※");

    private static final String INSTANCES_SYMBOLS_EMPTY = " ";
    private static final String ALL_SPACES = "\\s+";
    private static final String EMPTY = "";
    private final float relativeSize;
    private final char[] symbolArray;

    Symbol(final float relativeSize, final String values) {

        this.relativeSize = relativeSize;
        this.symbolArray = values.replaceAll(ALL_SPACES, EMPTY).toCharArray();
    }

    public float getRelativeSize() {
        return relativeSize;
    }

    public String getSymbol(final int numOfInstances) {

        if (numOfInstances == 0) {
            return INSTANCES_SYMBOLS_EMPTY;
        }

        int max = symbolArray.length - 1;
        return String.valueOf(numOfInstances > max ? symbolArray[max] : symbolArray[numOfInstances - 1]);
    }
}

@@ -155,16 +155,42 @@
 enums;%0A%0A
+import java.util.Arrays;%0A%0A
 // https
@@ -254,373 +254,394 @@
 2f, 
-%22%C2%B7 %E2%88%B6 %E2%88%B4 %E2%88%B7 %E2%97%87 %E2%97%88%22),%0A%0A    VERTICAL(1.2f, %22%C2%B7 %E2%88%B6 %E2%81%9D %E2%81%9E %7C%22),%0A%0A    CIRCLES(1.2f, %22%E2%97%94 %E2%97%91 %E2%97%95 %E2%97%8F %E0%B9%91%22),%0A%0A    NUMBERS(0.8f, %221 2 3 4 5 6 7 8 9 +%22),%0A%0A    ROMAN(0.8f, %22%E2%85%A0 %E2%85%A1 %E2%85%A2 %E2%85%A3 %E2%85%A4 %E2%85%A5 %E2%85%A6 %E2%85%A7 %E2%85%A8 %E2%85%A9 %E2%88%BE%22),%0A%0A    BINARY(1f, %22%E2%98%B1 %E2%98%B2 %E2%98%B3 %E2%98%B4 %E2%98%B5 %E2%98%B6 %E2%98%B7 %E2%80%BB%22);%0A%0A    private static final String INSTANCES_SYMBOLS_EMPTY = %22 %22;%0A    private static final String ALL_SPACES = %22%5C%5Cs+%22;%0A    private static final String EMPTY = %22%22;
+'%C2%B7', '%E2%88%B6', '%E2%88%B4', '%E2%88%B7', '%E2%97%87', '%E2%97%88'),%0A%0A    VERTICAL(1.2f, '%C2%B7', '%E2%88%B6', '%E2%81%9D', '%E2%81%9E', '%7C'),%0A%0A    CIRCLES(1.2f, '%E2%97%94', '%E2%97%91', '%E2%97%95', '%E2%97%8F', '%E0%B9%91'),%0A%0A    NUMBERS(0.8f, '1', '2', '3', '4', '5', '6', '7', '8', '9', '+'),%0A%0A    ROMAN(0.8f, '%E2%85%A0', '%E2%85%A1', '%E2%85%A2', '%E2%85%A3', '%E2%85%A4', '%E2%85%A5', '%E2%85%A6', '%E2%85%A7', '%E2%85%A8', '%E2%85%A9', '%E2%88%BE'),%0A%0A    BINARY(1f, '%E2%98%B1', '%E2%98%B2', '%E2%98%B3', '%E2%98%B4', '%E2%98%B5', '%E2%98%B6', '%E2%98%B7', '%E2%80%BB');%0A%0A    private static final String INSTANCES_SYMBOLS_EMPTY = %22 %22;%0A
 %0A   
@@ -671,24 +671,25 @@
 lativeSize;%0A
+%0A
     private 
@@ -758,22 +758,23 @@
 , final 
-String
+char...
  values)
@@ -850,57 +850,43 @@
 y = 
-values.replaceAll(ALL_SPACES, EMPTY).toCharArray(
+Arrays.copyOf(values, values.length
 );%0A 

use char array instead of spaced string for symbols