xsul.den
Class DenRoutingTable

java.lang.Object
  extended byxsul.den.DenRoutingTable
All Implemented Interfaces:
RoutingTable

public class DenRoutingTable
extends java.lang.Object
implements RoutingTable


Field Summary
static long RELOAD_INTERVAL
           
 
Constructor Summary
DenRoutingTable()
           
DenRoutingTable(java.io.File data)
           
DenRoutingTable(int initialCapacity)
           
DenRoutingTable(int initialCapacity, float loadFactor)
           
 
Method Summary
 void clear()
          Clears the Routing Table so that it contains no keys.
 boolean contains(java.lang.Object value)
          Tests if some key maps into the specified value in this Routing Table.
 boolean containsKey(java.lang.String key)
          Tests if the specified object is a key in this Routing Table.
 boolean containsKey(java.net.URI key)
          Tests if the specified object is a key in this Routing Table.
 boolean containsValue(java.lang.Object value)
          Returns true if this Routing Table maps one or more keys to this value.
 java.util.Enumeration elements()
          Returns an enumeration of the values in this Routing Table.
 java.lang.Object get(java.lang.String key)
          Returns the value to which the specified key is mapped in this Routing Table.
 java.lang.Object get(java.net.URI key)
          Returns the value to which the specified key is mapped in this Routing Table.
 java.util.Map getTable()
          Returns the whole routing table.
 boolean isEmpty()
          Tests if this Routing Table maps no keys to values.
 java.util.Enumeration keys()
          Returns an enumeration of the keys in this Routing Table.
 java.lang.Object put(java.lang.String key, java.lang.Object value)
          Maps the specified key to the specified value in this Routing Table.
 java.lang.Object put(java.net.URI key, java.lang.Object value)
          Maps the specified key to the specified value in this Routing Table.
 void putAll(RoutingTable t)
          Copies all of the mappings from the specified Map to this Routing Table These mappings will replace any mappings that this Routing Table had for any of the keys currently in the specified Routing Table.
 java.lang.Object remove(java.lang.String key)
          Removes the key (and its corresponding value) from this Routing Table.
 java.lang.Object remove(java.net.URI key)
          Removes the key (and its corresponding value) from this Routing Table.
 int size()
          Returns the number of keys in this Routing Table.
 java.util.Collection values()
          Returns a Collection view of the values contained in this Routing Table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELOAD_INTERVAL

public static final long RELOAD_INTERVAL
See Also:
Constant Field Values
Constructor Detail

DenRoutingTable

public DenRoutingTable(int initialCapacity,
                       float loadFactor)

DenRoutingTable

public DenRoutingTable(int initialCapacity)

DenRoutingTable

public DenRoutingTable()

DenRoutingTable

public DenRoutingTable(java.io.File data)
Method Detail

contains

public boolean contains(java.lang.Object value)
Description copied from interface: RoutingTable
Tests if some key maps into the specified value in this Routing Table.

Specified by:
contains in interface RoutingTable
Parameters:
value - a value to search for.
Returns:
true if and only if some key maps to the value argument in this Routing Table as determined by the equals method; false otherwise.
See Also:
RoutingTable.containsKey(String), RoutingTable.containsValue(Object)

elements

public java.util.Enumeration elements()
Description copied from interface: RoutingTable
Returns an enumeration of the values in this Routing Table. Use the Enumeration methods on the returned object to fetch the elements sequentially.

Specified by:
elements in interface RoutingTable
Returns:
an enumeration of the values in this Routing Table.
See Also:
Enumeration, RoutingTable.keys(), RoutingTable.values()

keys

public java.util.Enumeration keys()
Description copied from interface: RoutingTable
Returns an enumeration of the keys in this Routing Table.

Specified by:
keys in interface RoutingTable
Returns:
an enumeration of the keys in this Routing Table.
See Also:
Enumeration, RoutingTable.elements()

isEmpty

public boolean isEmpty()
Description copied from interface: RoutingTable
Tests if this Routing Table maps no keys to values.

Specified by:
isEmpty in interface RoutingTable
Returns:
true if this Routing Table maps no keys to values; false otherwise.

get

public java.lang.Object get(java.net.URI key)
Description copied from interface: RoutingTable
Returns the value to which the specified key is mapped in this Routing Table.

Specified by:
get in interface RoutingTable
Returns:
the value to which the key is mapped in this Routing Table; null if the key is not mapped to any value in this Routing Table.
See Also:
RoutingTable.put(URI, Object)

containsValue

public boolean containsValue(java.lang.Object value)
Description copied from interface: RoutingTable
Returns true if this Routing Table maps one or more keys to this value.

Specified by:
containsValue in interface RoutingTable
Parameters:
value - value whose presence in this Routing Table is to be tested.
Returns:
true if this Routing Table maps one or more keys to the specified value.

clear

public void clear()
Description copied from interface: RoutingTable
Clears the Routing Table so that it contains no keys.

Specified by:
clear in interface RoutingTable

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Description copied from interface: RoutingTable
Maps the specified key to the specified value in this Routing Table. Neither the key nor the value can be null.

The value can be retrieved by calling the get method with a key that is equal to the original key.

Specified by:
put in interface RoutingTable
Parameters:
key - the Routing Table key.
value - the value.
Returns:
the previous value of the specified key in this Routing Table, or null if it did not have one.
See Also:
Object.equals(Object), RoutingTable.get(String)

values

public java.util.Collection values()
Description copied from interface: RoutingTable
Returns a Collection view of the values contained in this Routing Table. The Collection is backed by the Routing Table, so changes to the Routing Table are reflected in the Collection, and vice-versa. The Collection supports element removal (which removes the corresponding entry from the Routing Table), but not element addition.

Specified by:
values in interface RoutingTable
Returns:
a collection view of the values contained in this Routing Table.

containsKey

public boolean containsKey(java.lang.String key)
Description copied from interface: RoutingTable
Tests if the specified object is a key in this Routing Table.

Specified by:
containsKey in interface RoutingTable
Parameters:
key - possible key.
Returns:
true if and only if the specified object is a key in this Routing Table, as determined by the equals method; false otherwise.
See Also:
RoutingTable.contains(Object)

putAll

public void putAll(RoutingTable t)
Description copied from interface: RoutingTable
Copies all of the mappings from the specified Map to this Routing Table These mappings will replace any mappings that this Routing Table had for any of the keys currently in the specified Routing Table.

Specified by:
putAll in interface RoutingTable
Parameters:
t - Mappings to be stored in this Routing Table.

put

public java.lang.Object put(java.net.URI key,
                            java.lang.Object value)
Description copied from interface: RoutingTable
Maps the specified key to the specified value in this Routing Table. Neither the key nor the value can be null.

The value can be retrieved by calling the get method with a key that is equal to the original key.

Specified by:
put in interface RoutingTable
Parameters:
key - the Routing Table key.
value - the value.
Returns:
the previous value of the specified key in this Routing Table, or null if it did not have one.
See Also:
Object.equals(Object), RoutingTable.get(URI)

containsKey

public boolean containsKey(java.net.URI key)
Description copied from interface: RoutingTable
Tests if the specified object is a key in this Routing Table.

Specified by:
containsKey in interface RoutingTable
Parameters:
key - possible key.
Returns:
true if and only if the specified object is a key in this Routing Table, as determined by the equals method; false otherwise.
See Also:
RoutingTable.contains(Object)

size

public int size()
Description copied from interface: RoutingTable
Returns the number of keys in this Routing Table.

Specified by:
size in interface RoutingTable
Returns:
the number of keys in this Routing Table.

remove

public java.lang.Object remove(java.net.URI key)
Description copied from interface: RoutingTable
Removes the key (and its corresponding value) from this Routing Table. This method does nothing if the key is not in the Routing Table.

Specified by:
remove in interface RoutingTable
Parameters:
key - the key that needs to be removed.
Returns:
the value to which the key had been mapped in this routing Table, or null if the key did not have a mapping.

get

public java.lang.Object get(java.lang.String key)
Description copied from interface: RoutingTable
Returns the value to which the specified key is mapped in this Routing Table.

Specified by:
get in interface RoutingTable
Parameters:
key - a key in the Routing Table.
Returns:
the value to which the key is mapped in this Routing Table; null if the key is not mapped to any value in this Routing Table.
See Also:
RoutingTable.put(String, Object)

remove

public java.lang.Object remove(java.lang.String key)
Description copied from interface: RoutingTable
Removes the key (and its corresponding value) from this Routing Table. This method does nothing if the key is not in the Routing Table.

Specified by:
remove in interface RoutingTable
Parameters:
key - the key that needs to be removed.
Returns:
the value to which the key had been mapped in this routing Table, or null if the key did not have a mapping.

getTable

public java.util.Map getTable()
Description copied from interface: RoutingTable
Returns the whole routing table.

Specified by:
getTable in interface RoutingTable
Returns:
a map view of the whole Routing Table.


IU Extreme! Lab (http://www.extreme.indiana.edu)