public class Triangle
extends java.lang.Object
Triangle
class.
This represents a triangle and is included in this library for use
with the static triangulation method of Graph
.
Triangle
is a Graph
with three vertices and two edges. In other words, is
the complete Graph when k = 3.Constructor and Description |
---|
Triangle()
This is the default constructor for
Triangle objects.The three vertices are set to null . |
Triangle(Vertex vertexA,
Vertex vertexB,
Vertex vertexC)
This is the constructor for
Triangle objects. |
Modifier and Type | Method and Description |
---|---|
Vertex |
getVertexA()
Getter for Vertex A.
|
Vertex |
getVertexB()
Getter for Vertex B.
|
Vertex |
getVertexC()
Getter for Vertex C.
|
void |
setVertexA(Vertex vertex)
Setter for Vertex A.
|
void |
setVertexB(Vertex vertex)
Setter for Vertex B.
|
void |
setVertexC(Vertex vertex)
Setter for Vertex C.
|
boolean |
sharesVertex(Triangle other)
This tests to see if any of the vertices of this
Triangle
are the same as any of the vertices of another Triangle . |
public Triangle()
Triangle
objects.null
.public Vertex getVertexA()
public void setVertexA(Vertex vertex)
vertex
- the new Vertex
location for vertex A.public Vertex getVertexB()
public void setVertexB(Vertex vertex)
vertex
- the new Vertex
location for vertex B.public Vertex getVertexC()
public void setVertexC(Vertex vertex)
vertex
- the new Vertex
location for vertex C.public boolean sharesVertex(Triangle other)
Triangle
are the same as any of the vertices of another Triangle
.other
- the other Triangle
to be compared.true
if any of the vertices of the other
Triangle
are the same as any of the vertices of this
Triangle
.