|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCmdType
Represents a single SNAC command type, or a group of all SNAC command types in a single family, or all SNAC commands. In practice, provides a means of listening for a specific set of commands on a SNAC connection.
Field Summary | |
static int |
ALL
A family type or command type that indicates all families or all command types within a family, depending on whether it is used as a family type or command type, respectively. |
static CmdType |
CMDTYPE_ALL
A CmdType that represents all possible command types.
|
Constructor Summary | |
CmdType(int family)
Creates a CmdType matching all commands in the given family.
|
|
CmdType(int family,
int command)
Creates a CmdType matching the given command in the given
family. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Returns true if these two objects represent the same set of
SNAC commands; false otherwise. |
int |
getCommand()
Returns the SNAC command type ("subtype") of the command represented by this CmdType , or CmdType.ALL if this object
represents every command in a given family. |
int |
getFamily()
Returns the SNAC family of the command(s) represented by this CmdType , or CmdType.ALL if all commands in all
families are represented. |
int |
hashCode()
Returns a hash code relatively unique to this set of SNAC commands. |
static CmdType |
ofCmd(SnacCommand command)
Returns a CmdType that represents the command type of the
given SNAC command object. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ALL
public static final CmdType CMDTYPE_ALL
CmdType
that represents all possible command types.
Equivalent to a new CmdType
instantiated using new
CmdType(CmdType.ALL, CmdType.ALL)
. In fact, that's what it is.
Constructor Detail |
public CmdType(int family)
CmdType
matching all commands in the given family.
Using this constructor is the equivalent to using CmdType(family,
CmdType.ALL)
. Note that family
can be
CmdType.ALL
, but it is recommended to simply use
CmdType.CMDTYPE_ALL
instead of creating a new instance.
family
- the SNAC family for this CmdType
, or
CmdType.ALL
public CmdType(int family, int command) throws java.lang.IllegalArgumentException
CmdType
matching the given command in the given
family. command
can be CmdType.ALL
, in which
case this object will match all commands in the given family.
family
can also be CmdType.ALL
, if and only if
command
is CmdType.ALL
as well, in which case
this object will match all possible commands.
family
- the family of the commands to represent, or
CmdType.ALL
command
- the command type ("subtype") of the command to represent,
or CmdType.ALL
java.lang.IllegalArgumentException
- if family
is
CmdType.ALL
and command
is not, or
if either family
or command
are not
CmdType.ALL
or positive numbersMethod Detail |
public static CmdType ofCmd(SnacCommand command)
CmdType
that represents the command type of the
given SNAC command object.
command
- a SNAC command
public final int getFamily()
CmdType
, or CmdType.ALL
if all commands in all
families are represented.
CmdType.ALL
public final int getCommand()
CmdType
, or CmdType.ALL
if this object
represents every command in a given family. Also, if
getFamily()
returns CmdType.ALL
, this method
will return CmdType.ALL
as well, indicating that all
commands in all families are represented.
Cmd.ALL
public boolean equals(java.lang.Object o)
true
if these two objects represent the same set of
SNAC commands; false
otherwise.
o
- the other CmdType
to compare to
public int hashCode()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |