|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.web_visage.ichat.IChatMessage
public abstract class IChatMessage
Represents abstract iChat message structure.
iChat message pattern is following:
[0x13] ["iChat"] [incremental id string] [0x13 0x13] [sender] [0x13 0x13]
[command name] [0x13 0x13] [command parameters]
Command parameter pattern is following:
[parameter string] [0x13 0x13] [parameter string] [0x13]
This implementation is not completely immutable since it changes it's inner state, but is is free from the external changes and is compeletely thread-safe.
| Field Summary |
|---|
| Fields inherited from interface com.web_visage.ichat.IChatMessageConstants |
|---|
BEGIN_END_MARKER, COMMON_LINE, ICHAT_TAG, PRIVATE_TAG, SEPARATOR, WILDCARD |
| Constructor Summary | |
|---|---|
IChatMessage(int aMsgNumber,
EnumIChatCommand aCommand,
IChatSender aSender,
java.lang.String[] aParameters)
Constructor. |
|
| Method Summary | |
|---|---|
abstract void |
acceptVisitor(IChatMessageVisitor aVisitor)
Accepts the IChatMessageVisitorimplementations. |
byte[] |
asByteArray()
Generates a byte array representation of the message. |
boolean |
equals(java.lang.Object anObj)
|
EnumIChatCommand |
getCmd()
Returns message's command. |
int |
getMsgNumber()
Returns incremental message id. |
java.lang.String |
getParameter(int anIdx)
Returns parameter by the given parameter index. |
java.lang.String[] |
getParameters()
Returns command's parameters. |
IChatSender |
getSender()
Returns a sender. |
int |
getSize()
Returns byte-representation's size of the message. |
int |
hashCode()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IChatMessage(int aMsgNumber,
EnumIChatCommand aCommand,
IChatSender aSender,
java.lang.String[] aParameters)
aMsgNumber - -
incremental message idaCommand - -
iChat commandaSender - -
a senderaParameters - -
command's parameters, allows null| Method Detail |
|---|
public final int getSize()
public final byte[] asByteArray()
iChat messages pattern is following:
[0x19] ["iChat"] [0x13 0x13] [incremental id string] [0x13 0x13] [Sender] [0x13 0x13]
[Command name] [0x13 0x13] [parameters]
Command parameter pattern is following:
[parameter string] [0x13 0x13] [parameter string] [0x13]
asByteArray in interface ByteRepresentablepublic final EnumIChatCommand getCmd()
public final int getMsgNumber()
public final java.lang.String[] getParameters()
public final java.lang.String getParameter(int anIdx)
anIdx -
public final IChatSender getSender()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public boolean equals(java.lang.Object anObj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public abstract void acceptVisitor(IChatMessageVisitor aVisitor)
IChatMessageVisitorimplementations.
aVisitor -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||