MCPcopy Create free account
hub / github.com/antlr/codebuff / toArray

Method toArray

output/java_guava/1.4.17/CharEscaperBuilder.java:125–131  ·  view source on GitHub ↗

Convert this builder into an array of char[]s where the maximum index is the value of the highest character that has been seen. The array will be sparse in the sense that any unseen index will default to null. @return a "sparse" array that holds the replacement mappings.

()

Source from the content-addressed store, hash-verified

123
124
125 public char[][] toArray() {
126 char[][] result = new char[max + 1][];
127 for (Map.Entry<Character, String> entry : map.entrySet()) {
128 result[entry.getKey()] = entry.getValue().toCharArray();
129 }
130 return result;
131 }
132
133 /**
134 * Convert this builder into a char escaper which is just a decorator around the underlying array

Callers 1

toEscaperMethod · 0.95

Calls 4

entrySetMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65
toCharArrayMethod · 0.45

Tested by

no test coverage detected