1128 |
internTable.put(this, this); |
internTable.put(this, this); |
1129 |
return this; |
return this; |
1130 |
} |
} |
1131 |
|
|
1132 |
|
/** |
1133 |
|
* Creates a string from the character array. The array is first copied. |
1134 |
|
* |
1135 |
|
* @param data the array of characters |
1136 |
|
* |
1137 |
|
* @return a String object that contains the characters of the character array |
1138 |
|
*/ |
1139 |
|
|
1140 |
|
public static String copyValueOf(char[] data) { |
1141 |
|
char[] duplicate = (char[]) data.clone(); |
1142 |
|
return new String(duplicate); |
1143 |
|
} |
1144 |
|
|
1145 |
|
/** |
1146 |
|
* Creates a string from the specifed character subarray. The array is first copied. |
1147 |
|
* |
1148 |
|
* @param data the array of characters |
1149 |
|
* @param offset the array index indicating the start of the subarray |
1150 |
|
* @param count the number of characters to use for the subarray |
1151 |
|
* |
1152 |
|
* @return a String object that contains the characters of the character subarray |
1153 |
|
*/ |
1154 |
|
|
1155 |
|
public static String copyValueOf(char[] data, int offset, int count) { |
1156 |
|
char[] duplicate = new char[count]; |
1157 |
|
System.arraycopy(duplicate, 0, data, offset, count); |
1158 |
|
return new String(duplicate); |
1159 |
|
} |
1160 |
} |
} |