Class XYZTable
java.lang.Object
|
+--XYZTable
- public class XYZTable
- extends java.lang.Object
A class to store named endpoints. The XYZTable class is an implementation
of the Singleton Pattern, as shown in Gamma et al (p. 127), which ensures
only one instance of the class is created, and provides access to that
instance.
Method Summary |
static XYZTable |
getInstance()
Returns the unique instance of the XYZTable class. |
javax.vecmath.Point3d |
getNamedEndpoint(java.lang.String name)
Returns the Point3d with the given name from the table. |
void |
putNamedEndpoint(java.lang.String name,
javax.vecmath.Point3d endpoint)
Puts a new Point3d into the table, using the given name. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
putNamedEndpoint
public void putNamedEndpoint(java.lang.String name,
javax.vecmath.Point3d endpoint)
- Puts a new Point3d into the table, using the given name.
- Parameters:
name
- the name for the endpoint.endpoint
- the endpoint object for the XYZ endpoint coordinates.
getNamedEndpoint
public javax.vecmath.Point3d getNamedEndpoint(java.lang.String name)
- Returns the Point3d with the given name from the table.
- Parameters:
name
- the name of the endpoint to retrieve.- Returns:
- the named endpoint coordinate object.
getInstance
public static XYZTable getInstance()
- Returns the unique instance of the XYZTable class. The actual instance
isn't initialized until
getInstance
is called by another
object.
- Returns:
- the only instance of the XYZTable.