public class RawBinary extends java.lang.Object implements java.lang.Iterable<RawBinary>
Modifier and Type | Field and Description |
---|---|
static int |
MIN_LENGTH_RAW
the minimum lenght of the shortest possible rawBinary in bytes
is 3 (bytes: { 1, 0, 0 } based on: id, type, length, no value) |
Constructor and Description |
---|
RawBinary() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(RawBinary child)
Adds the child to this node and sets its parent.
|
boolean |
equals(java.lang.Object obj) |
RawBinary |
getChild(byte id)
Returns a direct child of this element identified by its ID or null if there is no such an element
|
java.util.List<RawBinary> |
getChildren()
Returns the children of this element.
|
byte |
getId() |
byte[] |
getObjectValue()
Returns the byte representation of this object (-tree), i.e.
|
byte |
getType() |
byte[] |
getValue()
Returns the value which might be null
|
int |
hashCode() |
java.util.Iterator<RawBinary> |
iterator()
Returns an iterator that iterates the tree in main order
|
static RawBinary |
parse(byte[] octetArray)
Parses the given octet array and returns a RawBinary structure
|
void |
setId(byte id) |
void |
setType(byte type) |
void |
setValue(byte[] value) |
int |
size()
Returns the size of the tree, i.e.
|
java.lang.String |
toString() |
public static final int MIN_LENGTH_RAW
public byte[] getObjectValue()
public static RawBinary parse(byte[] octetArray) throws ParseException
octetArray
- octet arrayParseException
- if parsing failspublic byte getId()
public void setId(byte id)
id
- the id to setpublic byte getType()
public void setType(byte type)
type
- the type to setpublic byte[] getValue()
public void setValue(byte[] value)
value
- the value to setpublic RawBinary getChild(byte id)
id
- target IDpublic java.util.List<RawBinary> getChildren()
public java.lang.String toString()
toString
in class java.lang.Object
public void addChild(RawBinary child)
child
- child to addpublic int size()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object