org.metastatic.rsync
Class TwoKeyMap.SubTable

java.lang.Object
  |
  +--org.metastatic.rsync.TwoKeyMap.SubTable
All Implemented Interfaces:
Map.Entry, Serializable
Enclosing class:
TwoKeyMap

public class TwoKeyMap.SubTable
extends Object
implements Map.Entry, Serializable

A Map.Entry that contains another Map that is keyed with stronger, larger keys, and links to other SubTables whose key's lower four bytes are equivalent.

Since:
1.1
See Also:
Serialized Form

Field Summary
protected  Map data
          The sub-table, a Map that is an instance of TreeMap.
protected  Integer key
          The index in the array of sub-tables in which this entry is a member.
 
Method Summary
 boolean containsKey(TwoKeyMap.StrongKey key)
          Test if this sub-table contains the given key.
 boolean containsValue(Object value)
          Test if this sub-table contains the given value.
 boolean equals(Object o)
          Test if another object equals this one.
 Object get(TwoKeyMap.StrongKey key)
          Get the Object that is mapped by the strong key key.
 Object getKey()
          Get the key that maps to this entry.
 Object getValue()
          Get the value of this entry.
 int hashCode()
          Return the hash code for this entry.
 void put(TwoKeyMap.StrongKey key, Object value)
          Map the given key to the given value.
 Object setValue(Object value)
           
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected Map data
The sub-table, a Map that is an instance of TreeMap.

Since:
1.1

key

protected Integer key
The index in the array of sub-tables in which this entry is a member.

Since:
1.1
Method Detail

get

public Object get(TwoKeyMap.StrongKey key)
Get the Object that is mapped by the strong key key.

Parameters:
key - The key to look for in this sub-table.
Returns:
The object mapped to by the given key, or null if there is no such mapping.
Since:
1.1

put

public void put(TwoKeyMap.StrongKey key,
                Object value)
Map the given key to the given value.

Parameters:
key - The key.
value - The value.
Since:
1.1

containsKey

public boolean containsKey(TwoKeyMap.StrongKey key)
Test if this sub-table contains the given key.

Parameters:
key - The key to look for.
Returns:
true if there is a mapping from the given key.
Since:
1.1

containsValue

public boolean containsValue(Object value)
Test if this sub-table contains the given value.

Parameters:
value - The value to look for.
Returns:
true if there is a mapping to the given value.
Since:
1.1

equals

public boolean equals(Object o)
Test if another object equals this one.

Specified by:
equals in interface Map.Entry
Overrides:
equals in class Object
Parameters:
o - The object to test.
Returns:
true If o is an instance of this class and its fields are equivalent.
Throws:
ClassCastException - If o is not an instance of this class.
NullPointerException - If o is null.
Since:
1.1

getKey

public Object getKey()
Get the key that maps to this entry.

Specified by:
getKey in interface Map.Entry
Returns:
The key, a Integer that maps to this entry.
Since:
1.1

getValue

public Object getValue()
Get the value of this entry.

Specified by:
getValue in interface Map.Entry
Returns:
A Map that represents the sub-table.
Since:
1.1

hashCode

public int hashCode()
Return the hash code for this entry.

Specified by:
hashCode in interface Map.Entry
Overrides:
hashCode in class Object
Returns:
The hash code for the Map that implements this sub-table.
Since:
1.1

setValue

public Object setValue(Object value)
Specified by:
setValue in interface Map.Entry

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Returns:
A string representation of this object.
Since:
1.1