sdr 0.7

net.cscott.sdr
Class CommandInput.PossibleCommand

java.lang.Object
  extended by net.cscott.sdr.CommandInput.PossibleCommand
All Implemented Interfaces:
Iterable<CommandInput.PossibleCommand>
Enclosing class:
CommandInput

public abstract static class CommandInput.PossibleCommand
extends Object
implements Iterable<CommandInput.PossibleCommand>

A CommandInput.PossibleCommand is an Apply corresponding to the most likely interpretation of the user's input. If this Apply is inapplicable to the given formation, we can use the next() method to get the next-most-likely interpretation of the input, and try that before giving up and complaining to the user.


Field Summary
static String UNCLEAR_UTTERANCE
          A distinguished string used to indicate an error condition.
 
Constructor Summary
CommandInput.PossibleCommand()
           
 
Method Summary
 Apply getApply(DanceProgram dp)
          Return the parsed command possibility; throwing BadCallException if there is a problem with the parse.
abstract  long getEndTime()
          Return the time the user input was complete, in milliseconds since the epoch.
abstract  CommandInput.InputMode getMode()
          The mode used for this input.
abstract  long getStartTime()
          Return the time the user input began, in milliseconds since the epoch.
abstract  String getUserInput()
          Return the raw user input, or UNCLEAR_UTTERANCE if the input mechanism wasn't able to decipher the input.
 Iterator<CommandInput.PossibleCommand> iterator()
           
abstract  CommandInput.PossibleCommand next()
          Return the next possible command, or null if there are no more.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNCLEAR_UTTERANCE

public static final String UNCLEAR_UTTERANCE
A distinguished string used to indicate an error condition.

See Also:
Constant Field Values
Constructor Detail

CommandInput.PossibleCommand

public CommandInput.PossibleCommand()
Method Detail

getUserInput

public abstract String getUserInput()
Return the raw user input, or UNCLEAR_UTTERANCE if the input mechanism wasn't able to decipher the input.


getMode

public abstract CommandInput.InputMode getMode()
The mode used for this input.


getStartTime

public abstract long getStartTime()
Return the time the user input began, in milliseconds since the epoch.


getEndTime

public abstract long getEndTime()
Return the time the user input was complete, in milliseconds since the epoch.


next

public abstract CommandInput.PossibleCommand next()
Return the next possible command, or null if there are no more.


getApply

public final Apply getApply(DanceProgram dp)
                     throws BadCallException
Return the parsed command possibility; throwing BadCallException if there is a problem with the parse.

Throws:
BadCallException

iterator

public final Iterator<CommandInput.PossibleCommand> iterator()
Specified by:
iterator in interface Iterable<CommandInput.PossibleCommand>

sdr 0.7

Copyright © 2006-2009 C. Scott Ananian