|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectxsul.dispatcher.routingtable.RoutingTableImpl
An implementation of Routing Table. This implementation is based on a Concurrent Reader Hash Map and could be use a simple properties file to create its routing table.
EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap,
RoutingTable| Constructor Summary | |
RoutingTableImpl()
Create a Routing table from the /xsul/dispatcher/routingtable/table.properties file. |
|
RoutingTableImpl(java.io.File data)
Create a Routing table from a specified properties file. |
|
RoutingTableImpl(int initialCapacity)
Create an empty Routing table. |
|
RoutingTableImpl(int initialCapacity,
float loadFactor)
Create an empty Routing table. |
|
| 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 toKey)
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 |
| Constructor Detail |
public RoutingTableImpl(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the routing table.loadFactor - the load factor of the routing table.public RoutingTableImpl(int initialCapacity)
initialCapacity - the initial capacity of the routing table.public RoutingTableImpl()
/xsul/dispatcher/routingtable/table.properties file.
public RoutingTableImpl(java.io.File data)
data - the specified file.| Method Detail |
public void clear()
RoutingTable
clear in interface RoutingTableRoutingTable.clear()public boolean contains(java.lang.Object value)
RoutingTable
contains in interface RoutingTablevalue - a value to search for.
true if and only if some key maps to the
value argument in this Routing Table as determined
by the equals method; false otherwise.xsul.dispatcher.routingtable.RoutingTable#contains(xsul.dispatcher.routingtable.WS)public boolean containsKey(java.lang.String key)
RoutingTable
containsKey in interface RoutingTablekey - possible key.
true if and only if the specified object is a key
in this Routing Table, as determined by the equals
method; false otherwise.RoutingTable.containsKey(java.lang.String)public boolean containsValue(java.lang.Object value)
RoutingTable
containsValue in interface RoutingTablevalue - value whose presence in this Routing Table is to be tested.
xsul.dispatcher.routingtable.RoutingTable#containsValue(xsul.dispatcher.routingtable.WS)public java.util.Enumeration elements()
RoutingTable
elements in interface RoutingTableRoutingTable.elements()public java.lang.Object get(java.lang.String key)
RoutingTable
get in interface RoutingTablekey - a key in the Routing Table.
null if the key is not mapped to any value in this
Routing Table.RoutingTable.get(java.lang.String)public boolean isEmpty()
RoutingTable
isEmpty in interface RoutingTabletrue if this Routing Table maps no keys to values;
false otherwise.RoutingTable.isEmpty()public java.util.Enumeration keys()
RoutingTable
keys in interface RoutingTableRoutingTable.keys()
public java.lang.Object put(java.lang.String key,
java.lang.Object value)
RoutingTablekey 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.
put in interface RoutingTablekey - the Routing Table key.value - the value.
null if it did not have one.xsul.dispatcher.routingtable.RoutingTable#put(java.lang.String,
xsul.dispatcher.routingtable.WS)public void putAll(RoutingTable t)
RoutingTable
putAll in interface RoutingTablet - Mappings to be stored in this Routing Table.xsul.dispatcher.routingtable.RoutingTable#putAll(xsul.dispatcher.routingtable.RoutingTableImpl)public java.lang.Object remove(java.lang.String key)
RoutingTable
remove in interface RoutingTablekey - the key that needs to be removed.
null if the key did not have a mapping.RoutingTable.remove(java.lang.String)public int size()
RoutingTable
size in interface RoutingTableRoutingTable.size()public java.util.Collection values()
RoutingTable
values in interface RoutingTableRoutingTable.values()public java.util.Map getTable()
RoutingTable
getTable in interface RoutingTablepublic boolean containsKey(java.net.URI key)
RoutingTable
containsKey in interface RoutingTablekey - possible key.
true if and only if the specified object is a key
in this Routing Table, as determined by the equals
method; false otherwise.RoutingTable.containsKey(java.net.URI)public java.lang.Object get(java.net.URI toKey)
RoutingTable
get in interface RoutingTablenull if the key is not mapped to any value in this
Routing Table.RoutingTable.get(java.net.URI)
public java.lang.Object put(java.net.URI key,
java.lang.Object value)
RoutingTablekey 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.
put in interface RoutingTablekey - the Routing Table key.value - the value.
null if it did not have one.xsul.dispatcher.routingtable.RoutingTable#put(java.net.URI,
xsul.dispatcher.routingtable.WS)public java.lang.Object remove(java.net.URI key)
RoutingTable
remove in interface RoutingTablekey - the key that needs to be removed.
null if the key did not have a mapping.RoutingTable.remove(java.net.URI)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||