public char[] add(char[] name) { int length = this.names.length; int index = CharOperation.hashCode(name) % length; char[] current; while ((current = this.names[index]) != null) { if (CharOperation.equals(current, name)) return current; if (++index == length) index = 0; } this.names[index] = name; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return name; }
public char[] add(char[] name) { int length = this.names.length; int index = CharOperation.hashCode(name) % length; char[] current; while ((current = this.names[index]) != null) { if (CharOperation.equals(current, name)) return current; if (++index == length) index = 0; } this.names[index] = name; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return name; }
public char[] add(char[] name) { int length = this.names.length; int index = CharOperation.hashCode(name) % length; char[] current; while ((current = this.names[index]) != null) { if (CharOperation.equals(current, name)) return current; if (++index == length) index = 0; } this.names[index] = name; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return name; }
public char[] add(char[] name) { int length = this.names.length; int index = CharOperation.hashCode(name) % length; char[] current; while ((current = this.names[index]) != null) { if (CharOperation.equals(current, name)) return current; if (++index == length) index = 0; } this.names[index] = name; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return name; }
public char[] add(char[] name) { int length = this.names.length; int index = CharOperation.hashCode(name) % length; char[] current; while ((current = this.names[index]) != null) { if (CharOperation.equals(current, name)) return current; if (++index == length) index = 0; } this.names[index] = name; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return name; }
public char[] add(char[] name) { int length = this.names.length; int index = CharOperation.hashCode(name) % length; char[] current; while ((current = this.names[index]) != null) { if (CharOperation.equals(current, name)) return current; if (++index == length) index = 0; } this.names[index] = name; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return name; }