edu.mit.sketch.geom
Class Vertex

java.lang.Object
  |
  +--java.awt.geom.Point2D
        |
        +--java.awt.Point
              |
              +--edu.mit.sketch.geom.Point
                    |
                    +--edu.mit.sketch.geom.Vertex
All Implemented Interfaces:
Cloneable, Comparator, GeometricObject, Paintable, Serializable, Terminal, Translatable

public class Vertex
extends Point
implements Serializable, Comparator

This class represents a Vertex described by a Point and its certainty.

See Also:
Serialized Form

Inner classes inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float
 
Field Summary
 double certainty
          The certainty
 int index
          The index
 
Fields inherited from class edu.mit.sketch.geom.Point
graphics, time_stamp
 
Fields inherited from class java.awt.Point
x, y
 
Fields inherited from interface edu.mit.sketch.geom.GeometricObject
CIRCLE, ELLIPSE, LINE, POINT, POLYGON, RECTANGLE, SQUARE
 
Constructor Summary
Vertex()
          The constructor.
Vertex(double certainty)
          The constructor.
Vertex(int x, int y)
          The constructor.
Vertex(int x, int y, double certainty)
          The constructor.
Vertex(Point point)
          The constructor.
Vertex(Point point, double certainty)
          The constructor.
Vertex(Vertex vertex)
          The constructor.
 
Method Summary
static Vertex[] appendVertices(Vertex[] vertices, Vertex vertex)
          Appends the input vertices with the argument vertex
static Vertex[] arrayListToArray(ArrayList vertices)
          Returns an array containing the elements of the Vector.
static Vertex[] cloneVertices(Vertex[] vertices)
          For obtaining a complete copy of an array of Vertex objects.
 int compare(Object o1, Object o2)
          Implement Comparator
 boolean equals(Object o1, Object o2)
          Implement Comparator
static Vertex[] removeDuplicateVertices(Vertex[] vertices)
          Remove repeating vertices
 void setIndex(int index)
          Set index
 String toString()
          Override toString
static Vertex[] vectorToArray(Vector vertices)
          Returns an array containing the elements of the Vector.
 
Methods inherited from class edu.mit.sketch.geom.Point
containsGeometricObject, containsGeometricObjects, distance, getDataPoints, getPolygonalBounds, getRectangularBounds, getTimeStamp, getType, magnitude, paint, paint, paint, paintOriginal, pointIsOn, pointIsOnOriginal, rotate, scale, setDataPoints, setGraphicsContext, setTimeStamp, spatialRelation, touches, translate
 
Methods inherited from class java.awt.Point
equals, getLocation, getX, getY, move, setLocation, setLocation, setLocation, translate
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

index

public int index
The index

certainty

public double certainty
The certainty
Constructor Detail

Vertex

public Vertex()
The constructor.

Vertex

public Vertex(Point point)
The constructor.

Vertex

public Vertex(int x,
              int y)
The constructor.

Vertex

public Vertex(double certainty)
The constructor.

Vertex

public Vertex(Point point,
              double certainty)
The constructor.

Vertex

public Vertex(int x,
              int y,
              double certainty)
The constructor.

Vertex

public Vertex(Vertex vertex)
The constructor.
Method Detail

setIndex

public void setIndex(int index)
Set index

toString

public String toString()
Override toString
Overrides:
toString in class Point

compare

public int compare(Object o1,
                   Object o2)
Implement Comparator
Specified by:
compare in interface Comparator

equals

public boolean equals(Object o1,
                      Object o2)
Implement Comparator

removeDuplicateVertices

public static Vertex[] removeDuplicateVertices(Vertex[] vertices)
Remove repeating vertices

cloneVertices

public static Vertex[] cloneVertices(Vertex[] vertices)
For obtaining a complete copy of an array of Vertex objects.

appendVertices

public static Vertex[] appendVertices(Vertex[] vertices,
                                      Vertex vertex)
Appends the input vertices with the argument vertex

arrayListToArray

public static Vertex[] arrayListToArray(ArrayList vertices)
Returns an array containing the elements of the Vector.

vectorToArray

public static Vertex[] vectorToArray(Vector vertices)
Returns an array containing the elements of the Vector.