edu.mit.sketch.ddg
Class ConstraintGraphEdge

java.lang.Object
  extended by edu.mit.sketch.ddg.ConstraintGraphEdge
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ConstraintGraphEdgeLabelled

public class ConstraintGraphEdge
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Represents a directed edge from one Primitive to another in the constraint graph. Stores:
- start point primitive
- end point primitive
- confidence (in the interval [0;1]) that the constraint holds
- relevance of the constraint ([0;1])

If the constraint represents a property instead of a relationship, the primitive will have a self loop - both the start and the end primitives will be the same.

ConstraintGraphEdge.java Created: Sat Nov 21 18:26:00 2001

Author:
Olya Veselova
See Also:
Serialized Form

Constructor Summary
ConstraintGraphEdge(ConstraintGraphEdge edge)
          Constructs an edge from a given edge
ConstraintGraphEdge(Primitive startPrimitive, Primitive endPrimitive, double confidence, double relevance)
          Constructs an edge.
 
Method Summary
 java.lang.Object clone()
          Clone the edge
 double confidence()
          Get confidence
 Primitive endPrimitive()
          Get end point primitive.
 boolean equals(java.lang.Object other)
           
 void print(java.io.PrintStream out, boolean printDetails)
          Print the edge to a given output stream.
 double relevance()
          Get relevance
 void setConfidence(double confidence)
          Set confidence.
 void setEndPrimitive(Primitive primitive)
          Set end point primitive.
 void setRelevance(double relevance)
          Set relevance.
 void setStartPrimitive(Primitive primitive)
          Set start point primitive.
 Primitive startPrimitive()
          Get start point primitive.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintGraphEdge

public ConstraintGraphEdge(Primitive startPrimitive,
                           Primitive endPrimitive,
                           double confidence,
                           double relevance)
                    throws ValueOutOfRangeException
Constructs an edge. Confidence and relevnce should be in the interval from [0;1] - throws an exception if it is not so.

Throws:
ValueOutOfRangeException

ConstraintGraphEdge

public ConstraintGraphEdge(ConstraintGraphEdge edge)
Constructs an edge from a given edge

Method Detail

startPrimitive

public Primitive startPrimitive()
Get start point primitive.


setStartPrimitive

public void setStartPrimitive(Primitive primitive)
Set start point primitive.


endPrimitive

public Primitive endPrimitive()
Get end point primitive.


setEndPrimitive

public void setEndPrimitive(Primitive primitive)
Set end point primitive.


confidence

public double confidence()
Get confidence


relevance

public double relevance()
Get relevance


setConfidence

public void setConfidence(double confidence)
                   throws ValueOutOfRangeException
Set confidence. Must be in [0;1] otherwise throws exception.

Throws:
ValueOutOfRangeException

setRelevance

public void setRelevance(double relevance)
                  throws ValueOutOfRangeException
Set relevance. Must be in [0;1] otherwise throws exception.

Throws:
ValueOutOfRangeException

print

public void print(java.io.PrintStream out,
                  boolean printDetails)
Print the edge to a given output stream. If the edge is just a self loop, print the primitive only once. If print details is true, print the confidence and relevance numbers. Otherwise print jus thet primitives' names.


equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

clone

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

Overrides:
clone in class java.lang.Object