edu.mit.sketch.ddg
Class ConstraintGraphEdgeList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by edu.mit.sketch.ddg.ConstraintGraphEdgeList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class ConstraintGraphEdgeList
extends java.util.Vector
implements java.io.Serializable

Represents a list of directed edges between primitives in the constraint graph. This is a list of ConstraintGraphEdges.

ConstraintGraphEdgeList.java Created: Sun Feb 10 19:04:00 2002

Author:
Olya Veselova
See Also:
Serialized Form

Constructor Summary
ConstraintGraphEdgeList()
          Construct an empty list
ConstraintGraphEdgeList(ConstraintGraphEdgeList other)
          Construct the list filling it in with the elements of a given list
 
Method Summary
 void addEdge(ConstraintGraphEdge edge)
          Add an edge.
 void addEdge(Primitive startPrimitive, Primitive endPrimitive, double confidence, double relevance)
          Add an edge.
 java.lang.Object clone()
          Clone the list
 boolean containsEdge(Primitive startPrimitive, Primitive endPrimitive)
          Checks whether a given edge is present in the list
 ConstraintGraphEdge getEdge(Primitive startPrimitive, Primitive endPrimitive)
          Get edge between the given primitives.
 ConstraintGraphEdgeList minus(ConstraintGraphEdgeList other)
          Return a list of edges that are in this list but not in the other.
 void print(java.io.PrintStream out, boolean printDetails)
          Print the edges to a given output stream.
 ConstraintGraphEdge removeEdge(Primitive startPrimitive, Primitive endPrimitive)
          Remove and edge between the given primitives and return it.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

ConstraintGraphEdgeList

public ConstraintGraphEdgeList()
Construct an empty list


ConstraintGraphEdgeList

public ConstraintGraphEdgeList(ConstraintGraphEdgeList other)
Construct the list filling it in with the elements of a given list

Method Detail

addEdge

public void addEdge(Primitive startPrimitive,
                    Primitive endPrimitive,
                    double confidence,
                    double relevance)
Add an edge.


addEdge

public void addEdge(ConstraintGraphEdge edge)
Add an edge.


getEdge

public ConstraintGraphEdge getEdge(Primitive startPrimitive,
                                   Primitive endPrimitive)
                            throws EdgeNotFoundException
Get edge between the given primitives. Throws an exception if the edge was not found.

Throws:
EdgeNotFoundException

containsEdge

public boolean containsEdge(Primitive startPrimitive,
                            Primitive endPrimitive)
Checks whether a given edge is present in the list


removeEdge

public ConstraintGraphEdge removeEdge(Primitive startPrimitive,
                                      Primitive endPrimitive)
                               throws EdgeNotFoundException
Remove and edge between the given primitives and return it. Throws an exception if the edge was not found.

Throws:
EdgeNotFoundException

print

public void print(java.io.PrintStream out,
                  boolean printDetails)
Print the edges to a given output stream. Prints the details about confidence and relevance, if printDetails is true.


minus

public ConstraintGraphEdgeList minus(ConstraintGraphEdgeList other)
Return a list of edges that are in this list but not in the other. Differentiate the edges if they are labelled and are from different constraints.


clone

public java.lang.Object clone()
Clone the list

Overrides:
clone in class java.util.Vector