com.guiseframework.input
Class KeystrokeInput

java.lang.Object
  extended by com.globalmentor.model.AbstractHashObject
      extended by com.guiseframework.input.AbstractGestureInput
          extended by com.guiseframework.input.KeystrokeInput
All Implemented Interfaces:
GestureInput, Input, KeyboardInput

public class KeystrokeInput
extends AbstractGestureInput
implements KeyboardInput

An encapsulation of key stroke input.

Author:
Garret Wilson

Constructor Summary
KeystrokeInput(Key key, Key... keys)
          Key and keys constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
          Determines if this object equals another object.
 Key getKey()
          The key that was pressed.
 int hashCode()
          Returns the hash code of this object.
 java.lang.String toString()
           
 
Methods inherited from class com.guiseframework.input.AbstractGestureInput
getKeys, hasAltKey, hasControlKey, hasShiftKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.guiseframework.input.GestureInput
getKeys, hasAltKey, hasControlKey, hasShiftKey
 

Constructor Detail

KeystrokeInput

public KeystrokeInput(Key key,
                      Key... keys)
Key and keys constructor.

Parameters:
keys - The keys that were pressed when this input occurred.
Throws:
java.lang.NullPointerException - if the given key and/or keys is null.
Method Detail

getKey

public Key getKey()
The key that was pressed.


hashCode

public int hashCode()
Returns the hash code of this object. This version extends the hash code of the underlying objects with the the key.

Overrides:
hashCode in class com.globalmentor.model.AbstractHashObject
Returns:
The hash code of this object.

equals

public boolean equals(java.lang.Object object)
Determines if this object equals another object. Besides the default checks, this version ensures that the keys are equal.

Overrides:
equals in class com.globalmentor.model.AbstractHashObject
Parameters:
object - The object to compare with this object.
Returns:
true if the given object is considered equal to this object.

toString

public java.lang.String toString()
Overrides:
toString in class com.globalmentor.model.AbstractHashObject
Returns:
A string representation of this object.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.