|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.message.MessagePart
public class MessagePart
There are three main types of information that can be stored in a MessagePart: serialized objectBytes, fileObject and primitive variables such as int, double, String etc... Each MessagePart can only contain ONE of these. The MessageParts are stored in a HashMap in Message. All constants in this class must be in the range 400-499
Field Summary | |
---|---|
static int |
ALLPRIMITIVES
If this MessagePart contains a one or more primitive values (which is stored as an array of bytes}, the method getMessagePartType() will return this constant. |
static int |
BOOLEAN
If this MessagePart contains a boolean, the method getMessagePartType() will return this
constant |
static int |
CHAR
If this MessagePart contains a char, the method getMessagePartType() will return this
constant |
static int |
CHARS
If this MessagePart contains an array of chars, the method getMessagePartType() will
return this constant |
static int |
DOUBLE
If this MessagePart contains a double, the method getMessagePartType() will return this
constant |
static int |
FILEINFO
If this MessagePart contains a FileInfo, the method getMessagePartType() will return this
constant |
static int |
FILEOBJECT
If this MessagePart contains a FileObject, the method getMessagePartType() will return this
constant |
static int |
FLOAT
If this MessagePart contains a float, the method getMessagePartType() will return this
constant |
static int |
INT
If this MessagePart contains an int, the method getMessagePartType() will return this
constant |
static int |
LONG
If this MessagePart contains a long, the method getMessagePartType() will return this
constant |
static int |
SERIALIZEDOBJECT
If this MessagePart contains a serialized object (which is stored as an array of bytes), the method getMessagePartType() will return this constant |
static int |
SHORT
If this MessagePart contains a short, the method getMessagePartType() will return this
constant |
static int |
STRING
If this MessagePart contains a String, the method getMessagePartType() will return this
constant |
Constructor Summary | |
---|---|
MessagePart(java.lang.String key,
boolean booleanValue)
Creates a MessagePart that contains a boolean |
|
MessagePart(java.lang.String key,
byte[] objectBytes)
Creates a MessagePart that contains an array of bytes |
|
MessagePart(java.lang.String key,
char charValue)
Creates a MessagePart that contains a char |
|
MessagePart(java.lang.String key,
char[] charsValue)
Creates a MessagePart that contains an array of chars |
|
MessagePart(java.lang.String key,
double doubleValue)
Creates a MessagePart that contains a double |
|
MessagePart(java.lang.String key,
FileInfo fileInfo)
Creates a MessagePart that contains a FileInfo object |
|
MessagePart(java.lang.String key,
FileObject fileObject)
Creates a MessagePart that contains a FileObject |
|
MessagePart(java.lang.String key,
float floatValue)
Creates a MessagePart that contains a float |
|
MessagePart(java.lang.String key,
int intValue)
Creates a MessagePart that contains an int |
|
MessagePart(java.lang.String key,
long longValue)
Creates a MessagePart that contains a long |
|
MessagePart(java.lang.String key,
short shortValue)
Creates a MessagePart that contains a short |
|
MessagePart(java.lang.String key,
java.lang.String stringValue)
Creates a MessagePart that contains a String |
Method Summary | |
---|---|
boolean |
getBooleanValue()
A call to this method persumes that there exists a boolean in this MessagePart. |
char[] |
getChars()
A call to this method persumes that there exists an array of chars in this MessagePart. |
char |
getCharValue()
A call to this method persumes that there exists a char in this MessagePart. |
double |
getDoubleValue()
A call to this method persumes that there exists a double in this MessagePart. |
FileInfo |
getFileInfo()
A call to this method persumes that there exists a FileInfo in this MessagePart. |
FileObject |
getFileObject()
A call to this method persumes that there exists a FileObject in this MessagePart. |
float |
getFloatValue()
A call to this method persumes that there exists a float in this MessagePart. |
int |
getIntValue()
A call to this method persumes that there exists a int in this MessagePart. |
java.lang.String |
getKey()
Returns the key of this MessagePart |
long |
getLongValue()
A call to this method persumes that there exists a long in this MessagePart. |
int |
getMessagePartType()
Returns what kind of MessagePart this is. |
byte[] |
getObjectBytes()
A call to this method persumes that there exists an array of bytes in this MessagePart. |
short |
getShortValue()
A call to this method persumes that there exists a short in this MessagePart. |
java.lang.String |
getStringValue()
A call to this method persumes that there exists a String in this MessagePart. |
void |
setKey(java.lang.String key)
Sets the key of this MessagePart |
void |
setMessagePartType(int messagePartType)
Sets the type of this MessagePart. |
void |
setObjectBytes(byte[] objectBytes)
Sets an array of bytes as contents of this MessagePart |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ALLPRIMITIVES
getMessagePartType()
will return this constant.
public static final int BOOLEAN
getMessagePartType()
will return this
constant
public static final int CHAR
getMessagePartType()
will return this
constant
public static final int CHARS
getMessagePartType()
will
return this constant
public static final int DOUBLE
getMessagePartType()
will return this
constant
public static final int FILEINFO
getMessagePartType()
will return this
constant
public static final int FILEOBJECT
getMessagePartType()
will return this
constant
public static final int FLOAT
getMessagePartType()
will return this
constant
public static final int INT
getMessagePartType()
will return this
constant
public static final int LONG
getMessagePartType()
will return this
constant
public static final int SERIALIZEDOBJECT
getMessagePartType()
will return this constant
public static final int SHORT
getMessagePartType()
will return this
constant
public static final int STRING
getMessagePartType()
will return this
constant
Constructor Detail |
---|
public MessagePart(java.lang.String key, FileInfo fileInfo)
key
- The key that identifies this MessagePartfileInfo
- Sets a FileInfo object as contents of this partpublic MessagePart(java.lang.String key, FileObject fileObject)
key
- The key that identifies this MessagePartfileObject
- Sets a FileObject object as contents of this partpublic MessagePart(java.lang.String key, int intValue)
key
- The key that identifies this MessagePartintValue
- Sets an int as contents of this partpublic MessagePart(java.lang.String key, double doubleValue)
key
- The key that identifies this MessagePartdoubleValue
- Sets a double as contents of this partpublic MessagePart(java.lang.String key, float floatValue)
key
- The key that identifies this MessagePartfloatValue
- Sets a float as contents of this partpublic MessagePart(java.lang.String key, short shortValue)
key
- The key that identifies this MessagePartshortValue
- Sets a short as contents of this partpublic MessagePart(java.lang.String key, java.lang.String stringValue)
key
- The key that identifies this MessagePartstringValue
- Sets a String as contents of this partpublic MessagePart(java.lang.String key, boolean booleanValue)
key
- The key that identifies this MessagePartbooleanValue
- Sets a boolean as contents of this partpublic MessagePart(java.lang.String key, char charValue)
key
- The key that identifies this MessagePartcharValue
- Sets a char as contents of this partpublic MessagePart(java.lang.String key, long longValue)
key
- The key that identifies this MessagePartlongValue
- Sets a long as contents of this partpublic MessagePart(java.lang.String key, char[] charsValue)
key
- The key that identifies this MessagePartcharsValue
- Sets a char as contents of this partpublic MessagePart(java.lang.String key, byte[] objectBytes)
key
- The key that identifies this MessagePartobjectBytes
- Sets a byte array as contents of this partMethod Detail |
---|
public void setKey(java.lang.String key)
key
- The key that identifies this MessagePartpublic java.lang.String getKey()
public byte[] getObjectBytes()
public void setObjectBytes(byte[] objectBytes)
objectBytes
- The array of bytes. This is either the bytes of a serialized object, or primitive
value(s) stored in an array of bytes.public int getMessagePartType()
ALLPRIMITIVES
, BOOLEAN
, CHARS
, DOUBLE
, FILEINFO
,
FILEOBJECT
, FLOAT
, INT
, LONG
, SHORT
, SERIALIZEDOBJECT
or STRING
.
public void setMessagePartType(int messagePartType)
messagePartType
- Must be one of the following: ALLPRIMITIVES
, BOOLEAN
,
CHARS
, DOUBLE
, FILEINFO
, FILEOBJECT
, FLOAT
,
INT
, LONG
, SHORT
, SERIALIZEDOBJECT
or STRING
.public boolean getBooleanValue()
public char[] getChars()
public char getCharValue()
public double getDoubleValue()
public float getFloatValue()
public int getIntValue()
public long getLongValue()
public short getShortValue()
public java.lang.String getStringValue()
public FileObject getFileObject()
public FileInfo getFileInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |