easik.sketch.path
Class SketchPath

java.lang.Object
  extended by easik.sketch.path.SketchPath

public class SketchPath
extends java.lang.Object

This class is used to track path data used for constraints

Since:
2006-05-16 Kevin Green
Version:
2006-07-04 Kevin Green
Author:
Kevin Green 2006, Vera Ranieri 2006

Field Summary
private  EntityNode _coDomain
          The codomain of this path
private  EntityNode _domain
          The domain of this path
private  java.util.LinkedList<SketchEdge> _edges
          The list of edges comprising this path
private  java.lang.String _id
          The unique id of this path
 
Constructor Summary
SketchPath(EntityNode inEntity)
          Default constructor takes one entity
SketchPath(java.util.LinkedList<SketchEdge> inPath)
          Default constructor takes a LinkedList of edges
 
Method Summary
 void generateID()
          Generates a new ID based on the edges in the path
 EntityNode getCoDomain()
          Returns the codomain of the path
 EntityNode getDomain()
          Returns the domain of the path
 java.util.LinkedList<SketchEdge> getEdges()
          Returns the list of edges
 java.lang.String getId()
          Returns the ID of the path
static boolean pathsAreEqual(SketchPath a, SketchPath b)
          Method to determine whether two paths are equal, based on the edges that comprise the path.
static void renamePaths(java.util.HashMap<java.lang.String,SketchPath> paths, SketchEdge newEdge)
          Static method to rename a path in instances where an edge contained within the path has been renamed.
 java.lang.String toString()
          Overloaded method returns the _id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_id

private java.lang.String _id
The unique id of this path


_edges

private java.util.LinkedList<SketchEdge> _edges
The list of edges comprising this path


_domain

private EntityNode _domain
The domain of this path


_coDomain

private EntityNode _coDomain
The codomain of this path

Constructor Detail

SketchPath

public SketchPath(EntityNode inEntity)
Default constructor takes one entity

Parameters:
inEntity - An entity

SketchPath

public SketchPath(java.util.LinkedList<SketchEdge> inPath)
Default constructor takes a LinkedList of edges

Parameters:
inPath - A LinkedList of edges
Method Detail

generateID

public void generateID()
Generates a new ID based on the edges in the path


toString

public java.lang.String toString()
Overloaded method returns the _id

Overrides:
toString in class java.lang.Object
Returns:
The id of this path

getDomain

public EntityNode getDomain()
Returns the domain of the path

Returns:
The domain of the path

getId

public java.lang.String getId()
Returns the ID of the path

Returns:
The ID of the path

getEdges

public java.util.LinkedList<SketchEdge> getEdges()
Returns the list of edges

Returns:
The list of edges

getCoDomain

public EntityNode getCoDomain()
Returns the codomain of the path

Returns:
The codomain of the path

renamePaths

public static void renamePaths(java.util.HashMap<java.lang.String,SketchPath> paths,
                               SketchEdge newEdge)
Static method to rename a path in instances where an edge contained within the path has been renamed.

Parameters:
paths - hashMap of all paths to be searched for edge.
newEdge - The new name of the path
Since:
2006-05-29 Vera Ranieri

pathsAreEqual

public static boolean pathsAreEqual(SketchPath a,
                                    SketchPath b)
Method to determine whether two paths are equal, based on the edges that comprise the path. This determination is based on the id of the path, which in turn is based on the edges involved in the path.

Parameters:
a - The first path
b - The second path
Returns:
True if the paths are equal, false otherwise