de.javagl.simplemesh.impl
Class DefaultFace

java.lang.Object
  extended by de.javagl.simplemesh.impl.DefaultFace
All Implemented Interfaces:
Face, Indexed, java.io.Serializable

public class DefaultFace
extends java.lang.Object
implements Face

Default implementation of a Face. Note that comparing instances of this class will not take into account the index of the faces.

See Also:
Serialized Form

Constructor Summary
DefaultFace(int index, Vertex... vertices)
          Creates a new face with the given index and vertices
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getIndex()
          Returns the index of this object
 int getNumVertices()
          Returns the number of vertices of this face
 Vertex getVertex(int index)
          Returns the specified vertex
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultFace

public DefaultFace(int index,
                   Vertex... vertices)
Creates a new face with the given index and vertices

Parameters:
index - The index
vertices - The vertices
Method Detail

getIndex

public int getIndex()
Description copied from interface: Indexed
Returns the index of this object

Specified by:
getIndex in interface Indexed
Returns:
The index of this object

getVertex

public Vertex getVertex(int index)
Description copied from interface: Face
Returns the specified vertex

Specified by:
getVertex in interface Face
Parameters:
index - The vertex index
Returns:
The vertex

getNumVertices

public int getNumVertices()
Description copied from interface: Face
Returns the number of vertices of this face

Specified by:
getNumVertices in interface Face
Returns:
The number of vertices of this face

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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