com.tensegrity.composite.geometry
Class DefaultGeometryItemCoordinates

java.lang.Object
  extended bycom.tensegrity.composite.geometry.DefaultGeometryItemCoordinates
All Implemented Interfaces:
GeometryItemCoordinates

public class DefaultGeometryItemCoordinates
extends java.lang.Object
implements GeometryItemCoordinates

Default implementation of the GeometryItemCoordinates interface.

Version:
$Id: DefaultGeometryItemCoordinates.java,v 1.9 2006/02/20 12:52:08 MichaelKegel Exp $
Author:
MichaelKegel
See Also:
GeometryItemCoordinates

Constructor Summary
DefaultGeometryItemCoordinates(int[] componentsX, int[] componentsY)
          Constructor for DefaultGeometryItemCoordinates.
DefaultGeometryItemCoordinates(int[] componentsX, int[] componentsY, int[] componentsXRef, int[] componentsYRef, int[] segmentTypes)
          Constructor specifying the coordinates, the reference coordinates and and the segment-types.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int[] getComponentsX()
          Returns a copy of all stored x-coordinates in an int-array.
 int[] getComponentsY()
          Returns a copy of all stored y-coordinates in an int-array.
 int[] getCoordinate(int index)
          Returns the (x,y)-coordinate-pair stored at the given index.
 int getCoordinateCount()
          Returns the number of coordinate-pairs stored.
 int[] getReferenceComponentsX()
          Returns a copy of all stored reference x-coordinates.
 int[] getReferenceComponentsY()
          Returns a copy of all stored reference y-coordinates.
 int[] getSegmentTypes()
          Returns a copy of the int-array containing all segment-types.
 int hashCode()
           
 boolean hasSegmentTypes()
          Returns true, if segment-types are stored.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultGeometryItemCoordinates

public DefaultGeometryItemCoordinates(int[] componentsX,
                                      int[] componentsY)
Constructor for DefaultGeometryItemCoordinates.
The coordinates are given here separated by their components because the GraphicsAPI do also separate coordinates in that way in many cases.

Parameters:
componentsX - an array holding the x-components.
componentsY - an array holding the y-components.

DefaultGeometryItemCoordinates

public DefaultGeometryItemCoordinates(int[] componentsX,
                                      int[] componentsY,
                                      int[] componentsXRef,
                                      int[] componentsYRef,
                                      int[] segmentTypes)
Constructor specifying the coordinates, the reference coordinates and and the segment-types.

Parameters:
componentsX - an array holding the x-components.
componentsY - an array holding the y-components.
componentsXRef - an array holding the x-components of the reference coordinates.
componentsYRef - an array holding the y-components of the reference coordinates.
segmentTypes - an array holding the segment types.
Method Detail

getCoordinateCount

public int getCoordinateCount()
Description copied from interface: GeometryItemCoordinates
Returns the number of coordinate-pairs stored.

Specified by:
getCoordinateCount in interface GeometryItemCoordinates
Returns:
the number of coordinate-pairs stored.

hasSegmentTypes

public boolean hasSegmentTypes()
Description copied from interface: GeometryItemCoordinates
Returns true, if segment-types are stored.

Specified by:
hasSegmentTypes in interface GeometryItemCoordinates
Returns:
true, if segment-types are stored.

getCoordinate

public int[] getCoordinate(int index)
Description copied from interface: GeometryItemCoordinates
Returns the (x,y)-coordinate-pair stored at the given index. result[0] -> x, result[1] -> y.

Specified by:
getCoordinate in interface GeometryItemCoordinates
Parameters:
index - the index for which to retrieve th coordinate-pair.
Returns:
the coordinate-pair at the given index.

getComponentsX

public int[] getComponentsX()
Description copied from interface: GeometryItemCoordinates
Returns a copy of all stored x-coordinates in an int-array.

Specified by:
getComponentsX in interface GeometryItemCoordinates
Returns:
a copy of all stored x-coordinates.

getComponentsY

public int[] getComponentsY()
Description copied from interface: GeometryItemCoordinates
Returns a copy of all stored y-coordinates in an int-array.

Specified by:
getComponentsY in interface GeometryItemCoordinates
Returns:
a copy of all stored y-coordinates.

getReferenceComponentsX

public int[] getReferenceComponentsX()
Description copied from interface: GeometryItemCoordinates
Returns a copy of all stored reference x-coordinates.

Specified by:
getReferenceComponentsX in interface GeometryItemCoordinates
Returns:
a copy of all stored reference x-coordinates.

getReferenceComponentsY

public int[] getReferenceComponentsY()
Description copied from interface: GeometryItemCoordinates
Returns a copy of all stored reference y-coordinates.

Specified by:
getReferenceComponentsY in interface GeometryItemCoordinates
Returns:
a copy of all stored reference y-coordinates.

getSegmentTypes

public int[] getSegmentTypes()
Description copied from interface: GeometryItemCoordinates
Returns a copy of the int-array containing all segment-types.

Specified by:
getSegmentTypes in interface GeometryItemCoordinates
Returns:
a copy of the int-array containing all segment-types.

toString

public java.lang.String toString()
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.