movements
Class DanceData

java.lang.Object
  extended bymovements.DanceData
All Implemented Interfaces:
java.io.Serializable

public class DanceData
extends java.lang.Object
implements java.io.Serializable

DOCUMENT ME!

Version:
$Revision: 1.2 $
Author:
$author$
See Also:
Serialized Form

Field Summary
private  Position cachedHandPosition
          DOCUMENT ME!
private  int cachedHandPositionHandIndex
          DOCUMENT ME!
private  int cachedHandPositionPersonIndex
          DOCUMENT ME!
private  int cachedHandPositionTick
          DOCUMENT ME!
private  ParticipantPosition cachedPersonPosition
          The position of the person calculated during the previous call to getPositionDown, getPositionAcross, or getDirection.
private  int cachedPersonPositionPersonIndex
          The value of the 'personIndex' parameter passed to the last call to getPositionDown, getPositionAcross, or getDirection.
private  int cachedPersonPositionTick
          The value of the 'tick' parameter passed to the last call to getPositionDown, getPositionAcross, or getDirection.
(package private)  HandMovements[][] handMovements
          DOCUMENT ME!
(package private)  MusicPlayer musicPlayer
          DOCUMENT ME!
(package private)  int numberOfParticipants
          DOCUMENT ME!
(package private)  int numberOfTicksInDance
          DOCUMENT ME!
(package private)  ParticipantMovements[] peopleMovements
          DOCUMENT ME!
(package private)  int ticksPerBar
          DOCUMENT ME!
 
Constructor Summary
(package private) DanceData()
          Creates a new instance of DanceData
 
Method Summary
 double getDirection(int personIndex, int tick)
          DOCUMENT ME!
 double getHandPositionAcross(int personIndex, int handIndex, int tick)
          DOCUMENT ME!
 double getHandPositionDown(int personIndex, int handIndex, int tick)
          DOCUMENT ME!
 java.lang.String getName(int personIndex)
          Get the name of a person.
 int getNumberOfParticipants()
          DOCUMENT ME!
 long getNumberOfTicksInDance()
          DOCUMENT ME!
 double getPositionAcross(int personIndex, int tick)
          DOCUMENT ME!
 double getPositionDown(int personIndex, int tick)
          DOCUMENT ME!
 int getTicksPerBar()
          DOCUMENT ME!
 void playNote(int tick)
          If a note starts on the given tick then this method will play the note.
private  void readObject(java.io.ObjectInputStream in)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberOfParticipants

int numberOfParticipants
DOCUMENT ME!


peopleMovements

ParticipantMovements[] peopleMovements
DOCUMENT ME!


handMovements

HandMovements[][] handMovements
DOCUMENT ME!


musicPlayer

MusicPlayer musicPlayer
DOCUMENT ME!


ticksPerBar

int ticksPerBar
DOCUMENT ME!


numberOfTicksInDance

int numberOfTicksInDance
DOCUMENT ME!


cachedPersonPositionTick

private transient int cachedPersonPositionTick
The value of the 'tick' parameter passed to the last call to getPositionDown, getPositionAcross, or getDirection. If a call is made to one of these three methods and both the tick and the index of the person are the same as the previous call then the position of the person will already be stored in cachedPersonPosition and need not be calculated again.


cachedPersonPositionPersonIndex

private transient int cachedPersonPositionPersonIndex
The value of the 'personIndex' parameter passed to the last call to getPositionDown, getPositionAcross, or getDirection. If a call is made to one of these three methods and both the tick and the index of the person are the same as the previous call then the position of the person will already be stored in cachedPersonPosition and need not be calculated again.


cachedPersonPosition

private transient ParticipantPosition cachedPersonPosition
The position of the person calculated during the previous call to getPositionDown, getPositionAcross, or getDirection. If the next call to one of these three methods passes the same values for the tick and the person index then this cached position can be used. This saves re-calculating the position.


cachedHandPositionTick

private transient int cachedHandPositionTick
DOCUMENT ME!


cachedHandPositionPersonIndex

private transient int cachedHandPositionPersonIndex
DOCUMENT ME!


cachedHandPositionHandIndex

private transient int cachedHandPositionHandIndex
DOCUMENT ME!


cachedHandPosition

private transient Position cachedHandPosition
DOCUMENT ME!

Constructor Detail

DanceData

DanceData()
Creates a new instance of DanceData

Method Detail

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
DOCUMENT ME!

Parameters:
in - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.ClassNotFoundException - DOCUMENT ME!

getTicksPerBar

public int getTicksPerBar()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getName

public java.lang.String getName(int personIndex)
Get the name of a person.

Parameters:
personIndex - The index of the person, where the first person has an index of zero.
Returns:
The name of the person as given in the XML specification.

getPositionDown

public double getPositionDown(int personIndex,
                              int tick)
DOCUMENT ME!

Parameters:
personIndex - DOCUMENT ME!
tick - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPositionAcross

public double getPositionAcross(int personIndex,
                                int tick)
DOCUMENT ME!

Parameters:
personIndex - DOCUMENT ME!
tick - DOCUMENT ME!
Returns:
DOCUMENT ME!

getDirection

public double getDirection(int personIndex,
                           int tick)
DOCUMENT ME!

Parameters:
personIndex - DOCUMENT ME!
tick - DOCUMENT ME!
Returns:
DOCUMENT ME!

getHandPositionDown

public double getHandPositionDown(int personIndex,
                                  int handIndex,
                                  int tick)
DOCUMENT ME!

Parameters:
personIndex - DOCUMENT ME!
handIndex - DOCUMENT ME!
tick - DOCUMENT ME!
Returns:
DOCUMENT ME!

getHandPositionAcross

public double getHandPositionAcross(int personIndex,
                                    int handIndex,
                                    int tick)
DOCUMENT ME!

Parameters:
personIndex - DOCUMENT ME!
handIndex - DOCUMENT ME!
tick - DOCUMENT ME!
Returns:
DOCUMENT ME!

getNumberOfParticipants

public int getNumberOfParticipants()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getNumberOfTicksInDance

public long getNumberOfTicksInDance()
DOCUMENT ME!

Returns:
DOCUMENT ME!

playNote

public void playNote(int tick)
If a note starts on the given tick then this method will play the note. If no note starts on the given tick then this method does nothing.

Parameters:
tick - DOCUMENT ME!


Copyright © 2003 Nigel Westbury