org.metasyntactic.math
Class Edge

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--org.metasyntactic.math.Tuple
                          |
                          +--org.metasyntactic.math.Edge
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class Edge
extends Tuple

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.metasyntactic.math.Tuple
cachedHash, oldModCount
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Edge(java.lang.Object from, java.lang.Object to)
           
Edge(Tuple tuple)
           
 
Method Summary
 boolean add(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
          (u, v) and (v, u) are considered to be the same edge
 java.lang.Object from()
           
 boolean isSelfLoop()
          Edges from a vertex to itself
 java.lang.Object to()
           
 java.lang.String toString()
          By convention we use the notation (u, v) for an edge rather that the set notation {u, v}.
 
Methods inherited from class org.metasyntactic.math.Tuple
hashCode, order
 
Methods inherited from class java.util.ArrayList
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

Edge

public Edge(Tuple tuple)

Edge

public Edge(java.lang.Object from,
            java.lang.Object to)
     throws java.lang.IllegalArgumentException
Method Detail

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.ArrayList

from

public java.lang.Object from()

to

public java.lang.Object to()

isSelfLoop

public boolean isSelfLoop()
Edges from a vertex to itself


toString

public java.lang.String toString()
By convention we use the notation (u, v) for an edge rather that the set notation {u, v}.

Overrides:
toString in class Tuple

equals

public boolean equals(java.lang.Object o)
(u, v) and (v, u) are considered to be the same edge

Specified by:
equals in interface java.util.List
Overrides:
equals in class java.util.AbstractList