|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.redfelineninja.util.Adjacency
A data structure to store Adjanceny properties.
This data structure does not have strict safety contraints. Errors are passed the the programmer as exceptions from the underlying code so their interpretation must be with care.
Constructor Summary | |
Adjacency()
Creates a new empty Adjancency matrix. |
|
Adjacency(java.util.Vector v)
Creates a new Adjancency matrix. |
Method Summary | |
void |
addElement(java.lang.Object o)
Add another label to the data structure. |
boolean |
contains(java.lang.Object obj)
Tests if the specifed object is a member of the Adjaceny matrix. |
void |
copyLabelsInto(java.lang.Object[] objs)
Copies the labels of this matrix into an array. |
void |
doubleLink(java.lang.Object a,
java.lang.Object b)
Makes a two directional link between a and b |
void |
doubleUnlink(java.lang.Object a,
java.lang.Object b)
Ensures that there is no link in either direction between a and b |
java.util.Enumeration |
labels()
Supplies an enumeration of all the labels used in this matrix. |
void |
link(java.lang.Object a,
java.lang.Object b)
Makes a link from a to b |
boolean |
linked(java.lang.Object a,
java.lang.Object b)
Tests for a link from a to b |
int |
size()
Gives the size of this adjacency matrix. |
java.lang.String |
toString()
|
void |
unlink(java.lang.Object a,
java.lang.Object b)
Ensures that there is no link from a to b |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Adjacency()
public Adjacency(java.util.Vector v)
v
- A vector to supply the headingsMethod Detail |
public void link(java.lang.Object a, java.lang.Object b)
a
- Source labelb
- Dest. labelpublic void doubleLink(java.lang.Object a, java.lang.Object b)
a
- labelb
- labelpublic void unlink(java.lang.Object a, java.lang.Object b)
a
- Source labelb
- Dest. labelpublic void doubleUnlink(java.lang.Object a, java.lang.Object b)
a
- labelb
- labelpublic boolean linked(java.lang.Object a, java.lang.Object b)
a
- Source labelb
- Dest. labelpublic void addElement(java.lang.Object o)
o
- Label to be addedpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean contains(java.lang.Object obj)
public int size()
public java.util.Enumeration labels()
public void copyLabelsInto(java.lang.Object[] objs)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |