|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<Tag,Object>
org.mobicents.protocols.smpp.message.tlv.TLVTableImpl
public class TLVTableImpl
Implementation of the TLVTable interface. This implementation will maintain the ordering of added parameters.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
TLVTableImpl()
|
|
| Method Summary | |
|---|---|
Object |
get(int tag)
Get the value for a tag. |
BitSet |
getBitmask(Tag tag)
Get the tag's value as a bit set. |
byte[] |
getBytes(Tag tag)
Get the tag's value as a byte array. |
int |
getInt(Tag tag)
Get the tag's value as an int. |
int |
getLength()
Get the length the parameters in the table would encode as. |
long |
getLong(Tag tag)
Get the tag's value as a long. |
String |
getString(Tag tag)
Get the tag's value as a string. |
Object |
put(Tag tag,
char value)
|
Object |
put(Tag tag,
int value)
|
Object |
put(Tag tag,
long value)
|
Object |
put(Tag tag,
Object value)
Set the value of a TLV. |
Object |
put(Tag tag,
short value)
|
void |
readFrom(PacketDecoder decoder,
int length)
Decode a full set of optional parameters from a byte array. |
void |
remove(int tag)
Remove (or un-set) a tag/value from this table. |
String |
toString()
|
void |
writeTo(PacketEncoder encoder)
Encode all the optional parameters in this table to an output stream. |
| Methods inherited from class java.util.LinkedHashMap |
|---|
clear, containsValue, get, removeEldestEntry |
| Methods inherited from class java.util.HashMap |
|---|
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, values |
| Constructor Detail |
|---|
public TLVTableImpl()
| Method Detail |
|---|
public void readFrom(PacketDecoder decoder,
int length)
readFrom in interface TLVTable
public void writeTo(PacketEncoder encoder)
throws IOException
writeTo in interface TLVTableout - The output stream to encode the parameters to.
IOException - If an error occurs writing to the output stream.public Object get(int tag)
get in interface TLVTabletag - The tag's integer value.public String getString(Tag tag)
getString in interface TLVTabletag - The tag to retrieve the value for.
null if the specified
tag is not set in this table.public int getInt(Tag tag)
getInt in interface TLVTabletag - The tag to retrieve the value for.
-1 if the specified
tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a number (castable as a java.lang.Number).public long getLong(Tag tag)
getLong in interface TLVTabletag - The tag to retrieve the value for.
-1 if the specified
tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a number (castable as a java.lang.Number).public BitSet getBitmask(Tag tag)
getBitmask in interface TLVTabletag - The tag to retrieve the value for.
java.util.BitSet, or
null if the specified tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a bit mask.public byte[] getBytes(Tag tag)
getBytes in interface TLVTabletag - The tag to retrieve the value for.
byte[], or null
if the specified tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a byte array.
public Object put(Tag tag,
Object value)
throws BadValueTypeException,
InvalidSizeForValueException
put in interface Map<Tag,Object>put in class HashMap<Tag,Object>tag - The tag of the parameter to set.value - The tag's value.
BadValueTypeException - If tag does not accept
the type that value is.
InvalidSizeForValueException - If value
exceeds either the minimum or maximum size allowed by tag.
public Object put(Tag tag,
char value)
put in interface TLVTable
public Object put(Tag tag,
short value)
put in interface TLVTable
public Object put(Tag tag,
int value)
put in interface TLVTable
public Object put(Tag tag,
long value)
put in interface TLVTablepublic void remove(int tag)
remove in interface TLVTabletag - The tag to remove from the table.public String toString()
toString in class AbstractMap<Tag,Object>public int getLength()
sizeof (smpp_header) + sizeof (mandatory_parameters)
+ sizeof (optional_parameters).
getLength in interface TLVTable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||