public boolean apply(int key) { list.add(get(key)); return true; } }
public boolean apply(int key) { list.add(get(key)); return true; } });
public boolean apply(int key) { list.add(get(key)); return true; } }
public boolean apply(int key, int value) { return containsKey(key) && get(key) == value; } }
public boolean apply(int key, int value) { return other.containsKey(key) && other.get(key) == value; } }) && other.forEachPair(new IntIntProcedure() {
public boolean apply(int key, int value) { return other.containsKey(key) && other.get(key) == value; } }
public boolean apply(int key) { return procedure.apply(key,get(key)); } }
public boolean apply(int key, int value) { return other.containsKey(key) && other.get(key) == value; } }
public boolean apply(int key, int value) { return containsKey(key) && get(key) == value; } }
public boolean apply(int key) { return procedure.apply(key,get(key)); } }
public boolean apply(int key, int value) { return containsKey(key) && get(key) == value; } });
public boolean apply(int key) { return procedure.apply(key, get(key)); } });
/** * Returns a string representation of the receiver, containing * the String representation of each key-value pair, sorted ascending by key. */ public String toString() { IntArrayList theKeys = keys(); //theKeys.sort(); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { int 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() { IntArrayList theKeys = keys(); //theKeys.sort(); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { int 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() { IntArrayList theKeys = keys(); // theKeys.sort(); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { int 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 value. */ public String toStringByValue() { IntArrayList theKeys = new IntArrayList(); keysSortedByValue(theKeys); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { int 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 value. */ public String toStringByValue() { IntArrayList theKeys = new IntArrayList(); keysSortedByValue(theKeys); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { int 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 value. */ public String toStringByValue() { IntArrayList theKeys = new IntArrayList(); keysSortedByValue(theKeys); StringBuffer buf = new StringBuffer(); buf.append("["); int maxIndex = theKeys.size() - 1; for (int i = 0; i <= maxIndex; i++) { int 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(); } /**
/** * Fills all keys and values <i>sorted ascending by key</i> into the specified lists. * Fills into the lists, starting at index 0. * After this call returns the specified lists both have a new size that equals <tt>this.size()</tt>. * <p> * <b>Example:</b> * <br> * <tt>keys = (8,7,6), values = (1,2,2) --> keyList = (6,7,8), valueList = (2,2,1)</tt> * * @param keyList the list to be filled with keys, can have any size. * @param valueList the list to be filled with values, can have any size. */ public void pairsSortedByKey(final IntArrayList keyList, final IntArrayList valueList) { keys(keyList); keyList.sort(); valueList.setSize(keyList.size()); for (int i=keyList.size(); --i >= 0; ) { valueList.setQuick(i,get(keyList.getQuick(i))); } } /**
/** * Fills all keys and values <i>sorted ascending by key</i> into the specified lists. * Fills into the lists, starting at index 0. * After this call returns the specified lists both have a new size that equals <tt>this.size()</tt>. * <p> * <b>Example:</b> * <br> * <tt>keys = (8,7,6), values = (1,2,2) --> keyList = (6,7,8), valueList = (2,2,1)</tt> * * @param keyList the list to be filled with keys, can have any size. * @param valueList the list to be filled with values, can have any size. */ public void pairsSortedByKey(final IntArrayList keyList, final IntArrayList valueList) { keys(keyList); keyList.sort(); valueList.setSize(keyList.size()); for (int i=keyList.size(); --i >= 0; ) { valueList.setQuick(i,get(keyList.getQuick(i))); } } /**