voronoi

Class Simplex

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet
          extended by voronoi.Simplex
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.Set

public class Simplex
extends java.util.AbstractSet
implements java.util.Set

A Simplex is an immutable set of vertices (usually Pnts).


Field Summary
static boolean moreInfo
           
 
Constructor Summary
Simplex(java.util.Collection collection)
          Constructor.
Simplex(java.lang.Object[] vertices)
          Constructor.
 
Method Summary
static java.util.Set boundary(java.util.Set simplexSet)
          Report the boundary of a Set of Simplices.
 int dimension()
          Dimension of the Simplex.
 boolean equals(java.lang.Object o)
          We want to allow for different simplices that share the same vertex set.
 java.util.List facets()
          Report the facets of this Simplex.
 int hashCode()
           
 boolean isNeighbor(Simplex simplex)
          True iff simplices are neighbors.
 java.util.Iterator iterator()
           
 int size()
           
 java.lang.String toString()
          String representation.
 
Methods inherited from class java.util.AbstractSet
removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

moreInfo

public static boolean moreInfo
Constructor Detail

Simplex

public Simplex(java.util.Collection collection)
Constructor.

Parameters:
collection - a Collection holding the Simplex vertices
Throws:
java.lang.IllegalArgumentException - if there are duplicate vertices

Simplex

public Simplex(java.lang.Object[] vertices)
Constructor.

Parameters:
vertices - the vertices of the Simplex.
Throws:
java.lang.IllegalArgumentException - if there are duplicate vertices
Method Detail

toString

public java.lang.String toString()
String representation.

Overrides:
toString in class java.util.AbstractCollection
Returns:
the String representation of this Simplex

dimension

public int dimension()
Dimension of the Simplex.

Returns:
dimension of Simplex (one less than number of vertices)

isNeighbor

public boolean isNeighbor(Simplex simplex)
True iff simplices are neighbors. Two simplices are neighbors if they are the same dimension and they share a facet.

Parameters:
simplex - the other Simplex
Returns:
true iff this Simplex is a neighbor of simplex

facets

public java.util.List facets()
Report the facets of this Simplex. Each facet is a set of vertices.

Returns:
an Iterable for the facets of this Simplex

boundary

public static java.util.Set boundary(java.util.Set simplexSet)
Report the boundary of a Set of Simplices. The boundary is a Set of facets where each facet is a Set of vertices.

Returns:
an Iterator for the facets that make up the boundary

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.Set
Specified by:
iterator in class java.util.AbstractCollection
Returns:
Iterator for Simplex's vertices.

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.Set
Specified by:
size in class java.util.AbstractCollection
Returns:
the size (# of vertices) of this Simplex

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.Set
Overrides:
hashCode in class java.util.AbstractSet
Returns:
the hashCode of this Simplex

equals

public boolean equals(java.lang.Object o)
We want to allow for different simplices that share the same vertex set.

Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.Set
Overrides:
equals in class java.util.AbstractSet
Returns:
true for equal Simplices