|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.klomp.snark.bencode.BEValue
public class BEValue
Holds different types that a bencoded byte array can represent. You need to call the correct get method to get the correct java type object. If the BEValue wasn't actually of the requested type you will get a InvalidBEncodingException.
Constructor Summary | |
---|---|
BEValue(byte[] value)
|
|
BEValue(java.util.List value)
|
|
BEValue(java.util.Map value)
|
|
BEValue(java.lang.Number value)
|
Method Summary | |
---|---|
byte[] |
getBytes()
Returns this BEValue as a byte[]. |
int |
getInt()
Returns this BEValue as int. |
java.util.List |
getList()
Returns this BEValue as a List of BEValues. |
long |
getLong()
Returns this BEValue as long. |
java.util.Map |
getMap()
Returns this BEValue as a Map of BEValue keys and BEValue values. |
java.lang.Number |
getNumber()
Returns this BEValue as a Number. |
java.lang.String |
getString()
Returns this BEValue as a String. |
java.lang.Object |
getValue()
return the untyped value |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BEValue(byte[] value)
public BEValue(java.lang.Number value)
public BEValue(java.util.List value)
public BEValue(java.util.Map value)
Method Detail |
---|
public java.lang.String getString() throws InvalidBEncodingException
InvalidBEncodingException
public byte[] getBytes() throws InvalidBEncodingException
InvalidBEncodingException
public java.lang.Number getNumber() throws InvalidBEncodingException
InvalidBEncodingException
public int getInt() throws InvalidBEncodingException
Number.intValue()
.
InvalidBEncodingException
public long getLong() throws InvalidBEncodingException
Number.longValue()
.
InvalidBEncodingException
public java.util.List getList() throws InvalidBEncodingException
InvalidBEncodingException
public java.util.Map getMap() throws InvalidBEncodingException
InvalidBEncodingException
public java.lang.Object getValue()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |