IntDict

All Methods Instance Methods Concrete Methods  Modifier and Type Method and Description void add(java.lang.String key, int amount)  void clear()

Remove all entries.

IntDict copy()

Returns a duplicate copy of this object.

void div(java.lang.String key, int amount)  java.lang.Iterable<IntDict.Entry> entries()  java.util.Iterator<IntDict.Entry> entryIterator()  int get(java.lang.String key)

Return a value for the specified key.

int get(java.lang.String key, int alternate)  FloatDict getPercent()

Sum all of the values in this dictionary, then return a new FloatDict of each key, divided by the total sum.

boolean hasKey(java.lang.String key)  void increment(IntDict dict)

Merge another dictionary into this one.

void increment(java.lang.String key)

Increase the value associated with a specific key by 1.

int index(java.lang.String what)  java.lang.String key(int index)  java.lang.String[] keyArray()

Return a copy of the internal keys array.

java.lang.String[] keyArray(java.lang.String[] outgoing)  java.util.Iterator<java.lang.String> keyIterator()  java.lang.Iterable<java.lang.String> keys()  int maxIndex()  java.lang.String maxKey()

return the key corresponding to the maximum value or null if no entries

int maxValue()  int minIndex()  java.lang.String minKey()  int minValue()  void mult(java.lang.String key, int amount)  void print()  int remove(java.lang.String key)  int removeIndex(int index)  void resize(int length)

Resize the internal data, this can only be used to shrink the list.

void save(java.io.File file)

Save tab-delimited entries to a file (TSV format, UTF-8 encoding)

void set(java.lang.String key, int amount)

Create a new key/value pair or change the value of one.

void setIndex(int index, java.lang.String key, int value)  int size()

Returns the number of key/value pairs

void sortKeys()

Sort the keys alphabetically (ignoring case).

void sortKeysReverse()

Sort the keys alphabetically in reverse (ignoring case).

void sortValues()

Sort by values in ascending order.

void sortValues(boolean stable)

Set true to ensure that the order returned is identical.

void sortValuesReverse()

Sort by values in descending order.

void sortValuesReverse(boolean stable)  void sub(java.lang.String key, int amount)  int sum()  long sumLong()  void swap(int a, int b)  java.lang.String toJSON()

Return this dictionary as a String in JSON format.

java.lang.String toString()  int value(int index)  int[] valueArray()

Create a new array and copy each of the values into it.

int[] valueArray(int[] array)

Fill an already-allocated array with the values (more efficient than creating a new array each time).

java.util.Iterator<java.lang.Integer> valueIterator()  java.lang.Iterable<java.lang.Integer> values()  void write(java.io.PrintWriter writer)

Write tab-delimited entries to a PrintWriter