fr.lri.swingstates.gestures
Class GestureClass

java.lang.Object
  extended by fr.lri.swingstates.gestures.GestureClass

public class GestureClass
extends java.lang.Object

A basic class of gestures.

Author:
Caroline Appert

Constructor Summary
GestureClass(java.lang.String n)
          Builds a new labeled class of gestures.
 
Method Summary
 void addExample(Gesture gesture)
          Adds an example of this class of gestures.
 java.util.Vector<Gesture> getGestures()
           
 java.lang.String getName()
          Returns the name of this class of gestures.
 int getNumberOfExamples()
           
 java.lang.Object read(java.io.DataInputStream in)
          Reads the definition of this gesture class from an input stream.
 boolean removeExample(Gesture gesture)
          Removes an example of this class of gestures.
 void setName(java.lang.String name)
          Sets the name of this gesture class.
 void write(java.io.DataOutputStream out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GestureClass

public GestureClass(java.lang.String n)
Builds a new labeled class of gestures.

Parameters:
n - The label of the class of gestures.
Method Detail

write

public void write(java.io.DataOutputStream out)
           throws java.io.IOException
Throws:
java.io.IOException

read

public java.lang.Object read(java.io.DataInputStream in)
                      throws java.io.IOException
Reads the definition of this gesture class from an input stream.

Parameters:
in - The input stream
Returns:
This gesture class initialized from input stream in.
Throws:
java.io.IOException - if a reading error occurs.

getName

public java.lang.String getName()
Returns the name of this class of gestures.

Returns:
the name of this class of gestures.

removeExample

public boolean removeExample(Gesture gesture)
Removes an example of this class of gestures.

Parameters:
gesture - The gesture to remove from this gesture class.
Returns:
True if this gesture has been found in this class and removed, false if the gesture has not been found in this class.

addExample

public void addExample(Gesture gesture)
Adds an example of this class of gestures.

Parameters:
gesture - The gesture to add to this gesture class.

setName

public void setName(java.lang.String name)
Sets the name of this gesture class.

Parameters:
name - the name.

getNumberOfExamples

public int getNumberOfExamples()
Returns:
the number of examples contained in this gesture class.

getGestures

public java.util.Vector<Gesture> getGestures()
Returns:
the set of gesture examples contained in this gesture class.