|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHashRoute
public class HashRoute
HashRoute is a particular route where order does not matter. HashRoutes are primarily used in Agent when they keep track of nodes they have already visited. The class stores Integers containing node numbers in a HashSet.
Field Summary | |
---|---|
private java.util.HashSet |
hash
|
Constructor Summary | |
---|---|
HashRoute(int load)
Constructs a blank HashRoute. |
Method Summary | |
---|---|
void |
addNewNode(int n)
Adds a node into the HashSet. |
int |
getSize()
Returns the number of nodes stored in the HashRoute. |
java.util.Iterator |
iterator()
Creates an iterator for the HashRoute pointing to the HashSet. |
void |
removeNode(int n)
Removes a node from the HashSet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.HashSet hash
Constructor Detail |
---|
public HashRoute(int load)
load
- The estimated size of the HashRouteMethod Detail |
---|
public void addNewNode(int n)
n
- Node to be added into the HashSetpublic void removeNode(int n)
n
- Node to be removed from the HashSetpublic java.util.Iterator iterator()
public int getSize()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |