public final class ActionNameMap
extends java.lang.Object
ActionNameMap
provides a mapping between
actions and corresponding action names.
The action name SHOULD be used by an application when the action
is presented to a user.
The action names in each map apply to a single locale
.
The application should get the appropriate
ActionNameMap
based on the desired locale
from the method
ContentHandler.getActionNameMap
.
The actions and corresponding action names are set when the
ActionNameMap
is created and are immutable thereafter.
The indices of the actions and action names are in the range
0 to size-1.Constructor and Description |
---|
ActionNameMap(java.lang.String[] actions,
java.lang.String[] actionnames,
java.lang.String locale)
Create a new map of actions to action names for a locale.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAction(int index)
Gets the action at the specified index.
|
java.lang.String |
getAction(java.lang.String actionname)
Gets the action for the action name.
|
java.lang.String |
getActionName(int index)
Gets the action name at the specified index.
|
java.lang.String |
getActionName(java.lang.String action)
Gets the action name for an action.
|
java.lang.String |
getLocale()
Gets the locale for this set of action names.
|
int |
size()
Gets the number of pairs of actions and action names.
|
public ActionNameMap(java.lang.String[] actions, java.lang.String[] actionnames, java.lang.String locale)
actions
- an array of actions; MUST NOT be null
actionnames
- an array of action names;
MUST NOT be null
locale
- of the action names; MUST NOT be null
;
should be formatted according to the locale syntax
conventions in ContentHandler
.IllegalArgumentException:
- actions
strings or
actionname
strings have
a length of zero,actions
and
actionnames
arrays
are unequal, or equal to zero, or actions
array includes any duplicate
actions.java.lang.NullPointerException
- if actions
,
actionnames
, locale
, or
any array element is null
.public java.lang.String getActionName(java.lang.String action)
action
- the action for which to get the associated action name;
MUST NOT be null
null
is returned
if the action is not found in the sequence of actionsjava.lang.NullPointerException
- if action is null
public java.lang.String getAction(java.lang.String actionname)
actionname
- the action name for which to get the
associated action; MUST NOT be null
null
is returned
if the actionname
is not found in the sequence
of action namesjava.lang.NullPointerException
- if actionname is null
public java.lang.String getLocale()
null
public int size()
public java.lang.String getAction(int index)
index
- the index of the actionjava.lang.IndexOutOfBoundsException
- if index is less than zero or
greater than or equal to the value of the size
method.public java.lang.String getActionName(int index)
index
- the index of the action namejava.lang.IndexOutOfBoundsException
- if index is less than zero or
greater than or equal to the value of the size
method.Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.