© 2006-2007 ETH Zurich

org.ximtec.igesture.core
Class ResultSet

java.lang.Object
  extended by org.ximtec.igesture.core.ResultSet

public class ResultSet
extends Object

Class representing a set of result objects.

Version:
1.0, Dec 2006
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch

Constructor Summary
ResultSet()
          Constructs a new result set.
ResultSet(int maxSize)
          Constructs a new result set with a specific maximal size.
ResultSet(Recogniser source)
          Constructs a new result set.
ResultSet(Recogniser source, int maxSize)
          Constructs a new result set with a specific maximal size.
 
Method Summary
 void addResult(Result result)
          Adds a result object to the result set.
 void addResults(Collection<Result> results)
          Adds a collection of result objects.
 boolean contains(GestureClass gestureClass)
          Returns true if the result set contains the given gesture class.
 Gesture<?> getGesture()
          Returns the gesture to be recognised.
 Result getResult()
          Returns the first result object which is also the result object with the highest recognition accuracy.
 Result getResult(int index)
          Returns the result for a given index position.
 List<Result> getResults()
          Returns a list containing all result objects.
 Recogniser getSource()
          Get the source Recogniser that created this ResultSet
 boolean isEmpty()
          Return true if the result set is empty.
 void setGesture(Gesture<?> gesture)
          Sets the gesture to be recognised.
 void setSource(Recogniser source)
          Set the source Recogniser that created this ResultSet.
 int size()
          Returns the number of results.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResultSet

public ResultSet()
Constructs a new result set.


ResultSet

public ResultSet(Recogniser source)
Constructs a new result set.

Parameters:
source - The source that created this resultset

ResultSet

public ResultSet(int maxSize)
Constructs a new result set with a specific maximal size.

Parameters:
maxSize - the maximal size of the result set.

ResultSet

public ResultSet(Recogniser source,
                 int maxSize)
Constructs a new result set with a specific maximal size.

Parameters:
source - the source that created this ResultSet
maxSize - the maximal size of the result set.
Method Detail

addResult

public void addResult(Result result)
Adds a result object to the result set. The result set is always ordered by the accuracy value of the result objects.

Parameters:
result - the result object to be added.

addResults

public void addResults(Collection<Result> results)
Adds a collection of result objects.

Parameters:
results - the result objects to be added.

getResults

public List<Result> getResults()
Returns a list containing all result objects.

Returns:
the list of result objects.

getResult

public Result getResult(int index)
Returns the result for a given index position.

Parameters:
index - the index of the result object to be returned.
Returns:
the result object for the given index position.

getResult

public Result getResult()
Returns the first result object which is also the result object with the highest recognition accuracy.

Returns:
the first result object or null if the result set does not contain any result objects.

contains

public boolean contains(GestureClass gestureClass)
Returns true if the result set contains the given gesture class.

Parameters:
gestureClass - the gesture class to be tested for.
Returns:
true if the result set contains the specified gesture class.

size

public int size()
Returns the number of results.

Returns:
the number of results in the result set.

isEmpty

public boolean isEmpty()
Return true if the result set is empty.

Returns:
true if the result set is empty.

setGesture

public void setGesture(Gesture<?> gesture)
Sets the gesture to be recognised.

Parameters:
gesture - the gesture to be recognised.

getGesture

public Gesture<?> getGesture()
Returns the gesture to be recognised.

Returns:
the gesture to be recognised.

toString

public String toString()
Overrides:
toString in class Object

getSource

public Recogniser getSource()
Get the source Recogniser that created this ResultSet

Returns:
the source

setSource

public void setSource(Recogniser source)
Set the source Recogniser that created this ResultSet.

Parameters:
source - the source to set

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.