public abstract class Token extends Object
BinaryStreamReader
and BinaryStreamWriter
.
A token consists of a type and (depending on this type) it may additionally have an ID (positive long number) and/or a value (String).
The first byte of the token represents how many subsequent bytes are used by the ID.
BinaryStreamReader
,
BinaryStreamWriter
Modifier and Type | Class and Description |
---|---|
static class |
Token.Attribute |
static class |
Token.EndNode |
static class |
Token.Formatter |
static class |
Token.MapIdToValue |
static class |
Token.StartNode |
static class |
Token.Value |
Modifier and Type | Field and Description |
---|---|
protected long |
id |
static byte |
TYPE_ATTRIBUTE |
static byte |
TYPE_END_NODE |
static byte |
TYPE_MAP_ID_TO_VALUE |
static byte |
TYPE_START_NODE |
static byte |
TYPE_VALUE |
static byte |
TYPE_VERSION |
protected String |
value |
Constructor and Description |
---|
Token(byte type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getId() |
byte |
getType() |
String |
getValue() |
int |
hashCode() |
abstract void |
readFrom(DataInput in,
byte idType) |
protected long |
readId(DataInput in,
byte idType) |
protected String |
readString(DataInput in) |
String |
toString() |
protected void |
writeId(DataOutput out,
long id,
byte idType) |
protected void |
writeString(DataOutput out,
String string) |
abstract void |
writeTo(DataOutput out,
byte idType) |
public static final byte TYPE_VERSION
public static final byte TYPE_MAP_ID_TO_VALUE
public static final byte TYPE_START_NODE
public static final byte TYPE_END_NODE
public static final byte TYPE_ATTRIBUTE
public static final byte TYPE_VALUE
protected long id
protected String value
public byte getType()
public long getId()
public String getValue()
public abstract void writeTo(DataOutput out, byte idType) throws IOException
IOException
public abstract void readFrom(DataInput in, byte idType) throws IOException
IOException
protected void writeId(DataOutput out, long id, byte idType) throws IOException
IOException
protected void writeString(DataOutput out, String string) throws IOException
IOException
protected long readId(DataInput in, byte idType) throws IOException
IOException
protected String readString(DataInput in) throws IOException
IOException
Copyright © 2004–2016 XStream. All rights reserved.