(CategoricalData[] cats, char delimiter)
| 843 | |
| 844 | |
| 845 | private static String[][] getSafeNames(CategoricalData[] cats, char delimiter) |
| 846 | { |
| 847 | String[][] catNamesToUse = new String[cats.length][]; |
| 848 | final char delim_replacement; |
| 849 | if(delimiter == '_')//avoid setting the replacment to the deliminater value itself! |
| 850 | delim_replacement = '-'; |
| 851 | else |
| 852 | delim_replacement = '_'; |
| 853 | for(int i = 0; i < catNamesToUse.length; i++) |
| 854 | { |
| 855 | catNamesToUse[i] = new String[cats[i].getNumOfCategories()]; |
| 856 | for(int j = 0; j < catNamesToUse[i].length; j++) |
| 857 | { |
| 858 | String name = cats[i].getOptionName(j).trim(); |
| 859 | |
| 860 | if(name.contains(String.valueOf(delimiter))) |
| 861 | name = name.replace(delimiter, delim_replacement); |
| 862 | |
| 863 | catNamesToUse[i][j] = name; |
| 864 | } |
| 865 | } |
| 866 | return catNamesToUse; |
| 867 | } |
| 868 | |
| 869 | private static boolean isNewLine(char ch) |
| 870 | { |
no test coverage detected