|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectInterestInfo
A data structure containing information about a "chat interest." A quick
example of a list of interest information follows (note that these are not
actual chat topics on AOL's AIM servers; I just made them up for an example).
Consider the given list of interests sent in an InterestListCmd
.
Type | Parent ID | Name |
---|---|---|
TYPE_CHILD | 34 | Cats |
TYPE_CHILD | 34 | Fish |
TYPE_PARENT | 34 | Pets |
TYPE_PARENT | 7 | Food |
TYPE_CHILD | 34 | Birds |
TYPE_CHILD | 0 | General Chat |
TYPE_CHILD | 7 | Pizza |
TYPE_CHILD | 0 | AIM Help |
Field Summary | |
static int |
TYPE_CHILD
An interest type indicating that the interest has no sub-interests. |
static int |
TYPE_PARENT
An interest type indicating that the interest has sub-interests. |
Constructor Summary | |
|
InterestInfo(int type,
int parent,
java.lang.String name)
Creates a new chat interest information block with the given properties. |
protected |
InterestInfo(int type,
int parent,
java.lang.String name,
int totalSize)
Creates a new chat interest information block with the given properties. |
Method Summary | |
java.lang.String |
getName()
Returns the name of this chat interest, like "Travel." |
int |
getParentId()
Returns the "parent ID" of this chat interest. |
int |
getTotalSize()
Returns the total size of this chat interest information block, as read from a block of binary data. |
int |
getType()
Returns the "interest type" of this chat interest. |
protected static InterestInfo |
readInterestInfo(ByteBlock block)
Generates a new chat interest information block from the given block of binary data. |
java.lang.String |
toString()
|
void |
write(java.io.OutputStream out)
Writes a representation of this object to the given stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int TYPE_PARENT
public static final int TYPE_CHILD
Constructor Detail |
protected InterestInfo(int type, int parent, java.lang.String name, int totalSize)
type
- the type of chat interest, like TYPE_PARENT
parent
- the parent ID of this chat interest: the ID of this
interest if the type is TYPE_PARENT
, or the ID of this
interest's parent if the type is TYPE_CHILD
name
- the name of this interest, like "Travel"
totalSize
- the total size of this object, as read from a block of
binary datapublic InterestInfo(int type, int parent, java.lang.String name)
type
- the type of chat interest, like TYPE_PARENT
parent
- the parent ID of this chat interest: the ID of this
interest if the type is TYPE_PARENT
, or the ID of this
interest's parent if the type is TYPE_CHILD
name
- the name of this interest, like "Travel"
Method Detail |
protected static InterestInfo readInterestInfo(ByteBlock block)
null
if no valid interest
information block can be read.
block
- a block of binary data containing a chat interest
information block
null
if none could be readpublic final int getType()
TYPE_CHILD
or TYPE_PARENT
. Note that this value
dictates the meaning of the parent ID.
TYPE_CHILD
public final int getParentId()
TYPE_PARENT
, this value represents
a unique ID for this chat interest. If the type is TYPE_CHILD
,
this value represents the unique ID of a "parent" interest under which
this interest should be listed.
public final java.lang.String getName()
public int getTotalSize()
-1
if
this block was not created from an incoming block of data.
public void write(java.io.OutputStream out) throws java.io.IOException
LiveWritable
write
in interface LiveWritable
out
- the stream to which to write
java.io.IOException
- if an I/O error occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |