© 2006-2007 ETH Zurich

org.ximtec.igesture.core.composite
Class IntervalConstraint

java.lang.Object
  extended by org.ximtec.igesture.core.DefaultPropertyChangeNotifier
      extended by org.ximtec.igesture.core.DefaultDataObject
          extended by org.ximtec.igesture.core.composite.DefaultConstraint
              extended by org.ximtec.igesture.core.composite.IntervalConstraint
All Implemented Interfaces:
Serializable, Constraint, DataObject, PropertyChangeNotifier
Direct Known Subclasses:
CardinalityDeviceConstraint

public class IntervalConstraint
extends DefaultConstraint

This class represents an interval constraint. All gestures must be performed within a certain time interval. It does not matter in which order and how they are related in time (e.g. sequential, concurrent or a mix).

Author:
Bjorn Puype, bpuype@gmail.com
See Also:
Serialized Form

Nested Class Summary
static class IntervalConstraint.Config
           
 
Field Summary
 
Fields inherited from class org.ximtec.igesture.core.composite.DefaultConstraint
DEFAULT_CONFIGURATION, df, gestures, gestureTime, processingTime, PROPERTY_GESTURES, setterMapping
 
Fields inherited from class org.ximtec.igesture.core.DefaultDataObject
PROPERTY_ID
 
Fields inherited from class org.ximtec.igesture.core.DefaultPropertyChangeNotifier
propertyChangeSupport
 
Constructor Summary
IntervalConstraint()
           
 
Method Summary
 Map<String,Calendar> determineTimeWindows()
          Determine the time window for each composing gesture.
 Set<String> generatePatterns(Map<String,String> charMapping)
          Generate all possible string patterns that represent the composite gesture.
 Calendar getDuration()
          Get the duration of the interval
 void setDuration(String time)
          Set the duration of the interval.
 String toString()
           
 boolean validateConditions(List<Gesture<?>> gestures, IDeviceManager manager)
          Validate the constraint conditions.
 
Methods inherited from class org.ximtec.igesture.core.composite.DefaultConstraint
addGestureClass, addGestureClass, addGestureClass, addGestureClass, getDistinctGestureClasses, getGestureClasses, getGestureEntries, getGestureTime, getNumberOfGestures, getParameter, getParameters, getTimeStamp, removeAllGestureClasses, removeGestureClass, setGestureTime, setParameter
 
Methods inherited from class org.ximtec.igesture.core.DefaultDataObject
accept, getId, setId
 
Methods inherited from class org.ximtec.igesture.core.DefaultPropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ximtec.igesture.core.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

IntervalConstraint

public IntervalConstraint()
Method Detail

setDuration

public void setDuration(String time)
                 throws ParseException
Set the duration of the interval.

Parameters:
time - duration in format "hh:mm:ss.SSS"
Throws:
ParseException - thrown if the duration could not be parsed

getDuration

public Calendar getDuration()
Get the duration of the interval


determineTimeWindows

public Map<String,Calendar> determineTimeWindows()
Description copied from interface: Constraint
Determine the time window for each composing gesture.

Specified by:
determineTimeWindows in interface Constraint
Specified by:
determineTimeWindows in class DefaultConstraint
Returns:
Mapping between the gesture name and the corresponding time window.

generatePatterns

public Set<String> generatePatterns(Map<String,String> charMapping)
Description copied from interface: Constraint
Generate all possible string patterns that represent the composite gesture.

Specified by:
generatePatterns in interface Constraint
Specified by:
generatePatterns in class DefaultConstraint
Parameters:
charMapping - Mapping between the gesture class name and the character representation

validateConditions

public boolean validateConditions(List<Gesture<?>> gestures,
                                  IDeviceManager manager)
Description copied from interface: Constraint
Validate the constraint conditions.

Specified by:
validateConditions in interface Constraint
Overrides:
validateConditions in class DefaultConstraint
Parameters:
gestures - Gestures that possibly compose the composite gesture.
manager - Device manager to check the associated users.
Returns:

toString

public String toString()
Specified by:
toString in interface Constraint
Overrides:
toString in class DefaultConstraint

© 2006-2007 ETH Zurich

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