/** * Returns a string representation of the receiver, containing the String * representation of each key-value pair, sorted ascending by key. */ public String toString() { DoubleArrayList theKeys = keys(); theKeys.sort(); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { double key = theKeys.get(i); buf.append(String.valueOf(key)); buf.append("->"); buf.append(String.valueOf(get(key))); if (i < maxIndex) buf.append(", "); } buf.append("]"); return buf.toString(); }
/** * Returns a string representation of the receiver, containing * the String representation of each key-value pair, sorted ascending by key. */ public String toString() { DoubleArrayList theKeys = keys(); theKeys.sort(); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { double key = theKeys.get(i); buf.append(String.valueOf(key)); buf.append("->"); buf.append(String.valueOf(get(key))); if (i < maxIndex) buf.append(", "); } buf.append("]"); return buf.toString(); } /**
/** * Returns a string representation of the receiver, containing * the String representation of each key-value pair, sorted ascending by key. */ public String toString() { DoubleArrayList theKeys = keys(); theKeys.sort(); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { double key = theKeys.get(i); buf.append(String.valueOf(key)); buf.append("->"); buf.append(String.valueOf(get(key))); if (i < maxIndex) buf.append(", "); } buf.append("]"); return buf.toString(); } /**
/** * Returns a list filled with all keys contained in the receiver. * The returned list has a size that equals <tt>this.size()</tt>. * Note: Keys are filled into the list in no particular order. * However, the order is <i>identical</i> to the order used by method {@link #forEachKey(DoubleProcedure)}. * <p> * This method can be used to iterate over the keys of the receiver. * * @return the keys. */ public DoubleArrayList keys() { DoubleArrayList list = new DoubleArrayList(size()); keys(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>. * Note: Keys are filled into the list in no particular order. * However, the order is <i>identical</i> to the order used by method {@link #forEachKey(DoubleProcedure)}. * <p> * This method can be used to iterate over the keys of the receiver. * * @return the keys. */ public DoubleArrayList keys() { DoubleArrayList list = new DoubleArrayList(size()); keys(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>. Note: Keys are * filled into the list in no particular order. However, the order is * <i>identical</i> to the order used by method * {@link #forEachKey(DoubleProcedure)}. * <p> * This method can be used to iterate over the keys of the receiver. * * @return the keys. */ public DoubleArrayList keys() { DoubleArrayList list = new DoubleArrayList(size()); keys(list); return list; }
keys(keyList); values(valueList);
keys(keyList); values(valueList);
keys(keyList); values(valueList);
keys(keyList); keyList.sort(); valueList.setSize(keyList.size());
keys(keyList); keyList.sort(); valueList.setSize(keyList.size());
keys(keyList); keyList.sort(); valueList.setSize(keyList.size());