net.rim.device.api.media
Class WiredHeadsetMediaActionContext

java.lang.Object
  extended by net.rim.device.api.media.WiredHeadsetMediaActionContext

public class WiredHeadsetMediaActionContext
extends Object

The context object for media actions generated from wired headsets. All media actions generated from MediaActionHandler.SOURCE_WIRED_HEADSET will have context objects that are instances of this class.

Since:
BlackBerry API 5.0.0

Field Summary
static int BUTTON_NEXT_TRACK
          The "next track" button of a wired headset.
static int BUTTON_PLAYPAUSE
          The "play/pause" button of a wired headset.
static int BUTTON_PREV_TRACK
          The "previous track" button of a wired headset.
static int BUTTON_UNDEFINED
          An undefined or unknown wired headset button.
static int BUTTON_VOLUME_DOWN
          The "volume down" button of a wired headset.
static int BUTTON_VOLUME_UP
          The "volume up" button of a wired headset.
 
Constructor Summary
WiredHeadsetMediaActionContext(int button)
          Creates a new instance of WiredHeadsetMediaActionContext.
 
Method Summary
 boolean equals(Object obj)
          Tests an object for equality with this object.
 int getButton()
          Returns the button whose click generated the media action.
static String getButtonName(int button)
          Returns the name of a wired headset button.
 int hashCode()
          Returns a hash code value for the object.
 String toString()
          Generates and returns a String representation of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 



Field Detail

BUTTON_UNDEFINED

public static final int BUTTON_UNDEFINED
An undefined or unknown wired headset button.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_NEXT_TRACK

public static final int BUTTON_NEXT_TRACK
The "next track" button of a wired headset.

See Also:
WiredHeadsetMediaActionContext.BUTTON_PREV_TRACK, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_PREV_TRACK

public static final int BUTTON_PREV_TRACK
The "previous track" button of a wired headset.

See Also:
WiredHeadsetMediaActionContext.BUTTON_NEXT_TRACK, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_PLAYPAUSE

public static final int BUTTON_PLAYPAUSE
The "play/pause" button of a wired headset. For a wired headset that has only one button, this is the value that will be used for its single button.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_VOLUME_DOWN

public static final int BUTTON_VOLUME_DOWN
The "volume down" button of a wired headset.

See Also:
WiredHeadsetMediaActionContext.BUTTON_VOLUME_UP, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_VOLUME_UP

public static final int BUTTON_VOLUME_UP
The "volume up" button of a wired headset.

See Also:
WiredHeadsetMediaActionContext.BUTTON_VOLUME_DOWN, Constant Field Values
Since:
BlackBerry API 5.0.0


Constructor Detail

WiredHeadsetMediaActionContext

public WiredHeadsetMediaActionContext(int button)
Creates a new instance of WiredHeadsetMediaActionContext.

Parameters:
button - the button that was pressed; should be one of the BUTTON_ constants defined in this class, but this is not enforced; this value is returned from WiredHeadsetMediaActionContext.getButton().
Since:
BlackBerry API 5.0.0


Method Detail

equals

public boolean equals(Object obj)
Tests an object for equality with this object.

Overrides:
equals in class Object
Parameters:
obj - the object to test for equality with this object; may be null.
Returns:
true if and only if the specified Object is an instance of WiredHeadsetMediaActionContext and its getButton() method return the exact same values as that of this object; returns false in all other cases.
See Also:
Boolean.hashCode(), Hashtable
Since:
BlackBerry API 5.0.0

getButton

public int getButton()
Returns the button whose click generated the media action.

Returns:
one of the BUTTON_ constants defined in this class that corresponds to the button whose click generated the media action.
Since:
BlackBerry API 5.0.0

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable
Since:
BlackBerry API 5.0.0

toString

public String toString()
Generates and returns a String representation of this object.

Overrides:
toString in class Object
Returns:
a String representation of this object; never returns null.
Since:
BlackBerry API 5.0.0

getButtonName

public static String getButtonName(int button)
Returns the name of a wired headset button.

Parameters:
button - the button whose name to return; known values are the BUTTON_ constants defined in this class.
Returns:
the name of the specified button; returns Integer.toString(button) if the name of the specified buttons not known.
Since:
BlackBerry API 5.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal