edu.neu.ccs.demeterf.lib
Class Entry<Key,Val>

java.lang.Object
  extended by edu.neu.ccs.demeterf.lib.Entry<Key,Val>
All Implemented Interfaces:
java.lang.Comparable<Entry<Key,Val>>

public class Entry<Key,Val>
extends java.lang.Object
implements java.lang.Comparable<Entry<Key,Val>>

Class representing Map Entries (key/value Pairs). Use Entry.create(Key, Val) and Entry.create(Key, Val, Comparator) to create Entries when needed. You shouldn't really need to create them, unles you want to build a Map from an array or a List.


Nested Class Summary
static class Entry.key
          Field Class for key
static class Entry.val
          Field Class for val
 
Constructor Summary
Entry(Key k, Val v)
          Create an Entry from a Key/Value Pair
 
Method Summary
 int compareTo(Entry<Key,Val> e)
           
static
<Key extends java.lang.Comparable<Key>,Val>
Entry<Key,Val>
create(Key k, Val v)
          Create an Entry with a Comparable Key, and a Value.
static
<Key,Val> Entry<Key,Val>
create(Key k, Val v, java.util.Comparator<Key> c)
          Create an Entry with a Key, Value, and a Comparator for Keys.
 boolean equals(java.lang.Object o)
          Standard Equality
 Key getKey()
          Getter for Entry.key
 Val getVal()
          Getter for Entry.val
 int hashCode()
          Return the HashCode of htis Entry
 java.lang.String toString()
          Return a String representation of this Entry.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entry

public Entry(Key k,
             Val v)
Create an Entry from a Key/Value Pair

Method Detail

compareTo

public int compareTo(Entry<Key,Val> e)
Specified by:
compareTo in interface java.lang.Comparable<Entry<Key,Val>>

equals

public boolean equals(java.lang.Object o)
Standard Equality

Overrides:
equals in class java.lang.Object

getKey

public Key getKey()
Getter for Entry.key


getVal

public Val getVal()
Getter for Entry.val


toString

public java.lang.String toString()
Return a String representation of this Entry. Essentially "(Key -> Val)"

Overrides:
toString in class java.lang.Object

create

public static <Key extends java.lang.Comparable<Key>,Val> Entry<Key,Val> create(Key k,
                                                                                Val v)
Create an Entry with a Comparable Key, and a Value.


create

public static <Key,Val> Entry<Key,Val> create(Key k,
                                              Val v,
                                              java.util.Comparator<Key> c)
Create an Entry with a Key, Value, and a Comparator for Keys.


hashCode

public int hashCode()
Return the HashCode of htis Entry

Overrides:
hashCode in class java.lang.Object