Class Joint

java.lang.Object
  |
  +--Joint

public class Joint
extends java.lang.Object
implements java.lang.Cloneable

A class that encapsulates a robot Joint, including the 3D representation that will be used to render the Joint, a Degree object for each of the Joint's degrees of freedom, and the Joint's link length. All of the other Denavit-Hartenberg parameters are included in each Degree object.

See Also:
Robot, Degree

Constructor Summary
Joint()
          Creates and initializes a new joint.
 
Method Summary
 void addDegree(Degree degree)
          Add a Degree to the Joint.
 java.lang.Object clone()
          Implements the clone() method, returning an Object copy of the Joint.
 int countDegrees()
          Returns the number of degrees of freedom in this Joint.
 Degree getDegree(int i)
          Returns the specified Degree.
 java.util.Enumeration getDegrees()
          Returns an Enumeration all of the Degrees.
 double getLength()
          Returns the link length of the Joint.
 javax.media.j3d.Group getModel()
          Returns the 3D representation of this Joint.
 boolean isEmpty()
          Returns true if the Joint is empty.
 void setLength(double length)
          Sets the link length of the Joint.
 void setModelParser(java.lang.String modelParser)
          Set the ModelParser to be used to interpret the source file.
 void setSource(java.lang.String source)
          Sets the source filename of the joint's model representation.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Joint

public Joint()
Creates and initializes a new joint.
Method Detail

addDegree

public void addDegree(Degree degree)
Add a Degree to the Joint.
Parameters:
degree - the Degree object to be added to the Joint.

getDegree

public Degree getDegree(int i)
Returns the specified Degree.
Parameters:
i - the index of the requested Degree.
Returns:
the requested Degree.

getDegrees

public java.util.Enumeration getDegrees()
Returns an Enumeration all of the Degrees.
Returns:
the Enumeration of all Degrees in the Joint.

countDegrees

public int countDegrees()
Returns the number of degrees of freedom in this Joint.
Returns:
the number of degrees of freedom in the Joint.

isEmpty

public boolean isEmpty()
Returns true if the Joint is empty.
Returns:
true if the Joint is empty.

setSource

public void setSource(java.lang.String source)
Sets the source filename of the joint's model representation.
Parameters:
source - the name of the model source file.

getModel

public javax.media.j3d.Group getModel()
Returns the 3D representation of this Joint.
Returns:
the 3D representation of the Joint.

setModelParser

public void setModelParser(java.lang.String modelParser)
                    throws ModelParserException
Set the ModelParser to be used to interpret the source file. This method must be called after the source filename has been set, otherwise a ModelParserException will occur when the ModelParser class attempts to load the source file.
Parameters:
modelParser - the name of the ModelParser class to parse the source.
Throws:
ModelParserException - indicates an error loading the 3D model.

setLength

public void setLength(double length)
Sets the link length of the Joint.
Parameters:
length - the length of the link.

getLength

public double getLength()
Returns the link length of the Joint.
Returns:
the length of the link.

clone

public java.lang.Object clone()
Implements the clone() method, returning an Object copy of the Joint.
Returns:
the Object copy of the Joint.
Overrides:
clone in class java.lang.Object