Skip to content

Instantly share code, notes, and snippets.

@jonfriesen
Created November 13, 2013 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonfriesen/7450800 to your computer and use it in GitHub Desktop.
Save jonfriesen/7450800 to your computer and use it in GitHub Desktop.
/** Inner class for entries */
protected static class MyEntry<K,V> implements Entry<K,V> {
protected K k; // key
protected V v; // value
public MyEntry(K key, V value) {
k = key;
v = value;
}
// methods of the Entry interface
public K getKey() { return k; }
public V getValue() { return v; }
// overrides toString, useful for debugging
public String toString() { return "(" + k + "," + v + ")"; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment