|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface INodeSet
Defines an interface by which sets of INode objects are accessed.
Define this instead of, say, using the Collection
approach
because it will be simpler, and because there are some domain specific
operations appropriate for sets of INode
that are not immediately
supported by the JDK package.
Method Summary | |
---|---|
INode |
contains(INode n)
Return the actual node in storage that is equal to the given node. |
void |
insert(INode n)
Inserts node based on inherent behavior. |
boolean |
isEmpty()
Is collection empty. |
java.util.Iterator<INode> |
iterator()
Return iterator to the existing board states. |
INode |
remove()
Remove minimum node based on inherent behavior. |
boolean |
remove(INode n)
Remove node from node set. |
int |
size()
Return the number of states in the set. |
Method Detail |
---|
boolean isEmpty()
int size()
INode contains(INode n)
The signature of this method may look odd. Recall that If the node doesn't exist then return null.
n
- Board state to be inspectedjava.util.Iterator<INode> iterator()
INode remove()
boolean remove(INode n)
The parameter is either an actual node in the node set or a copy of one of its nodes.
n
- Board state to be removedvoid insert(INode n)
It is the responsibility of the caller to ensure that the node does not already
exist in the list, using the contains(INode)
method.
n
- Board state to be inserted
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |