/** * Returns a list filled with all values contained in the receiver. The returned list has a size that equals * <tt>this.size()</tt>. Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link * #forEachKey(CharProcedure)}. <p> This method can be used to iterate over the values of the receiver. * * @return the values. */ public DoubleArrayList values() { DoubleArrayList list = new DoubleArrayList(size()); values(list); return list; }
/** * Returns a list filled with all keys contained in the receiver. The returned list has a size that equals * <tt>this.size()</tt>. Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link * #forEachKey(CharProcedure)}. <p> This method can be used to iterate over the keys of the receiver. * * @return the keys. */ public CharArrayList keys() { CharArrayList list = new CharArrayList(size()); keys(list); return list; }
/** * Fills all keys <i>sorted ascending by their associated value</i> into the specified list. Fills into the list, * starting at index 0. After this call returns the specified list has a new size that equals <tt>this.size()</tt>. * Primary sort criterium is "value", secondary sort criterium is "key". This means that if any two values are equal, * the smaller key comes first. <p> <b>Example:</b> <br> <tt>keys = (8,7,6), values = (1,2,2) --> keyList = * (8,6,7)</tt> * * @param keyList the list to be filled, can have any size. */ public void keysSortedByValue(CharArrayList keyList) { pairsSortedByValue(keyList, new DoubleArrayList(size())); }
public int hashCode() { final int[] buf = new int[size()]; forEachPair( new CharDoubleProcedure() { int i = 0; @Override public boolean apply(char key, double value) { buf[i++] = HashUtils.hash(key) ^ HashUtils.hash(value); return true; } } ); Arrays.sort(buf); return IntBuffer.wrap(buf).hashCode(); }
/** * Returns a list filled with all keys contained in the receiver. The returned list has a size that equals * <tt>this.size()</tt>. Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link * #forEachKey(CharProcedure)}. <p> This method can be used to iterate over the keys of the receiver. * * @return the keys. */ public CharArrayList keys() { CharArrayList list = new CharArrayList(size()); keys(list); return list; }
/** * Fills all keys <i>sorted ascending by their associated value</i> into the specified list. Fills into the list, * starting at index 0. After this call returns the specified list has a new size that equals <tt>this.size()</tt>. * Primary sort criterium is "value", secondary sort criterium is "key". This means that if any two values are equal, * the smaller key comes first. <p> <b>Example:</b> <br> <tt>keys = (8,7,6), values = (1,2,2) --> keyList = * (8,6,7)</tt> * * @param keyList the list to be filled, can have any size. */ public void keysSortedByValue(CharArrayList keyList) { pairsSortedByValue(keyList, new DoubleArrayList(size())); }
/** * Returns a list filled with all values contained in the receiver. The returned list has a size that equals * <tt>this.size()</tt>. Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link * #forEachKey(CharProcedure)}. <p> This method can be used to iterate over the values of the receiver. * * @return the values. */ public DoubleArrayList values() { DoubleArrayList list = new DoubleArrayList(size()); values(list); return list; }
/** * Fills all keys <i>sorted ascending by their associated value</i> into the specified list. Fills into the list, * starting at index 0. After this call returns the specified list has a new size that equals <tt>this.size()</tt>. * Primary sort criterium is "value", secondary sort criterium is "key". This means that if any two values are equal, * the smaller key comes first. <p> <b>Example:</b> <br> <tt>keys = (8,7,6), values = (1,2,2) --> keyList = * (8,6,7)</tt> * * @param keyList the list to be filled, can have any size. */ public void keysSortedByValue(CharArrayList keyList) { pairsSortedByValue(keyList, new DoubleArrayList(size())); }
/** * Returns a list filled with all keys contained in the receiver. The returned list has a size that equals * <tt>this.size()</tt>. Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link * #forEachKey(CharProcedure)}. <p> This method can be used to iterate over the keys of the receiver. * * @return the keys. */ public CharArrayList keys() { CharArrayList list = new CharArrayList(size()); keys(list); return list; }
/** * Returns a list filled with all values contained in the receiver. The returned list has a size that equals * <tt>this.size()</tt>. Iteration order is guaranteed to be <i>identical</i> to the order used by method {@link * #forEachKey(CharProcedure)}. <p> This method can be used to iterate over the values of the receiver. * * @return the values. */ public DoubleArrayList values() { DoubleArrayList list = new DoubleArrayList(size()); values(list); return list; }
public int hashCode() { final int[] buf = new int[size()]; forEachPair( new CharDoubleProcedure() { int i = 0; @Override public boolean apply(char key, double value) { buf[i++] = HashUtils.hash(key) ^ HashUtils.hash(value); return true; } } ); Arrays.sort(buf); return IntBuffer.wrap(buf).hashCode(); }