|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.graph.ImmutableIdentityEdge
public class ImmutableIdentityEdge
Graph.Edge that provides an immutable edge that uses its properties as its identity to implement .equals() and .hashCode(). Two ImmutableIdentityEdge instances with the same tail, head, user object, and direction will be considered the same edge. In the future, additional edge subclasses may provide additional immutable properties that allow for different edges containing the same properties listed above. This is a start down that path and will help keep many other places clean until then.
Constructor Summary | |
---|---|
ImmutableIdentityEdge(com.phoenixst.plexus.Graph.Edge edge)
Creates a new edge with the same properties as the specified edge. |
|
ImmutableIdentityEdge(java.lang.Object userObject,
java.lang.Object tail,
java.lang.Object head,
boolean directed)
Creates a new edge with the specified properties. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object object)
Returns true if the specified object is an ImmutableIdentityEdge that has the same tail, head, user object, and direction as this edge. |
java.lang.Object |
getHead()
|
java.lang.Object |
getOtherEndpoint(java.lang.Object node)
|
java.lang.Object |
getTail()
|
java.lang.Object |
getUserObject()
|
int |
hashCode()
Returns a hash code value consistent with the .equals() implementation. |
boolean |
isDirected()
|
void |
setUserObject(java.lang.Object object)
Throws an UnsupportedOperationException because this edge implementation is immutable. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ImmutableIdentityEdge(java.lang.Object userObject, java.lang.Object tail, java.lang.Object head, boolean directed)
public ImmutableIdentityEdge(com.phoenixst.plexus.Graph.Edge edge)
Method Detail |
---|
public boolean isDirected()
isDirected
in interface com.phoenixst.plexus.Graph.Edge
public java.lang.Object getUserObject()
getUserObject
in interface com.phoenixst.plexus.Graph.Edge
public void setUserObject(java.lang.Object object)
setUserObject
in interface com.phoenixst.plexus.Graph.Edge
public java.lang.Object getTail()
getTail
in interface com.phoenixst.plexus.Graph.Edge
public java.lang.Object getHead()
getHead
in interface com.phoenixst.plexus.Graph.Edge
public java.lang.Object getOtherEndpoint(java.lang.Object node)
getOtherEndpoint
in interface com.phoenixst.plexus.Graph.Edge
public boolean equals(java.lang.Object object)
equals
in interface com.phoenixst.plexus.Graph.Edge
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface com.phoenixst.plexus.Graph.Edge
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |