public class TLVChain extends ArrayList
modCount
Constructor and Description |
---|
TLVChain()
Creates a new TLV chain.
|
TLVChain(int size)
Creates a new TLV chain of the specified size.
|
Modifier and Type | Method and Description |
---|---|
void |
addByte(int type,
int value)
Add a byte to this TLV chain.
|
void |
addBytes(int type,
byte[] value)
Add a byte array to this TLV chain.
|
void |
addCaps(int type,
int caps)
Add a capabilities to this TLV chain.
|
void |
addChatRoom(int type,
Chat chat)
Add a chat room to this TLV chain.
|
void |
addInt(int type,
int value)
Add an integer to this TLV chain.
|
void |
addNull(int type)
Add a null TLV to a null TLV to this TLV chain.
|
void |
addShort(int type,
int value)
Add a short to this TLV chain.
|
void |
addString(int type,
String value)
Add a string to this TLV chain.
|
void |
addTLV(TLV tlv)
Add a TLV to this TLV chain.
|
void |
addTLVChain(int type,
TLVChain tlvchain)
Add a TLV chain to this TLV chain.
|
Object |
clone()
Clone this TLV chain.
|
boolean |
equals(Object obj)
Test two TLV chains for equality.
|
TLV |
getTLV(int type,
int n)
Get the n-th occurence of a TLV of the specified type in this
TLV chain.
|
int |
hashCode()
Return the hashcode of this TLVChain.
|
int |
length()
Return the length of this TLV chain in bytes
|
void |
removeTLV(int type,
int n)
Remove the n-th occurence of a TLV of the specified type in this TLV
chain.
|
int |
size()
Return the number of TLV's in this TLV chain.
|
String |
toString()
Return a string representation of this TLV chain.
|
add, add, addAll, addAll, clear, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, subList, toArray, toArray, trimToSize
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll
public TLVChain()
public TLVChain(int size)
size
- the number of TLV's that you are going to add to this chainpublic void addString(int type, String value) throws IOException
type
- the type of TLVvalue
- the string to addIOException
- if an error occurspublic void addNull(int type) throws IOException
type
- the type of TLVIOException
- if an error occurspublic void addByte(int type, int value) throws IOException
type
- the type of TLVvalue
- the byte to addIOException
- if an error occurspublic void addBytes(int type, byte[] value) throws IOException
type
- the type of TLVvalue
- the byte array to addIOException
- if an error occurspublic void addShort(int type, int value) throws IOException
type
- the type of TLVvalue
- the short to addIOException
- if an error occurspublic void addInt(int type, int value) throws IOException
type
- the type of TLVvalue
- the integer to addIOException
- if an error occurspublic void addTLV(TLV tlv)
tlv
- the TLV to addpublic void addTLVChain(int type, TLVChain tlvchain) throws IOException
type
- the type of TLVtlvchain
- the TLV chain to addIOException
- if an error occurspublic void addCaps(int type, int caps) throws IOException
The bitfield passed in should be a bitwise OR of any of the
AIM_CAPS
constants in AIMConstants.
For
example:
type
- the type of TLVcaps
- the capability block to addIOException
- if an error occursAIMConstants
public void addChatRoom(int type, Chat chat) throws IOException
type
- the type of TLVchat
- the chat roomIOException
- if an error occurspublic int length()
public int size()
public TLV getTLV(int type, int n)
type
- the type of TLVn
- the occurencepublic void removeTLV(int type, int n)
type
- the type of TLVn
- the occurencepublic Object clone()
public boolean equals(Object obj)
equals
in interface Collection
equals
in interface List
equals
in class AbstractList
obj
- the TLV chain to testpublic int hashCode()
hashCode
in interface Collection
hashCode
in interface List
hashCode
in class AbstractList
public String toString()
toString
in class AbstractCollection