@Override public int size() { return set.size(); }
/** * Returns a new array containing the values in the set. * * @return an <code>int[]</code> value */ public int[] toArray() { int[] result = new int[size()]; int[] set = _set; byte[] states = _states; for (int i = states.length, j = 0; i-- > 0; ) { if (states[i] == FULL) { result[j++] = set[i]; } } return result; }
/** * Compares this set with another set for equality of their stored entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean equals(Object other) { if (!(other instanceof TIntHashSet)) { return false; } final TIntHashSet that = (TIntHashSet) other; if (that.size() != this.size()) { return false; } return forEach(new TIntProcedure() { public final boolean execute(int value) { return that.contains(value); } }); }