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

java.lang.Object
  extended by edu.neu.ccs.demeterf.demfgen.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
 
Field Summary
 Key key
           
 Val val
           
 
Constructor Summary
Entry(Key k, Val v)
          Craete 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
 java.lang.String toString()
          Return a String representation of this Entry.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

key

public final Key key

val

public final Val val
Constructor Detail

Entry

public Entry(Key k,
             Val v)
Craete 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

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.