public abstract class Token
extends java.lang.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 java.lang.String |
value |
Constructor and Description |
---|
Token(byte type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
long |
getId() |
byte |
getType() |
java.lang.String |
getValue() |
int |
hashCode() |
abstract void |
readFrom(java.io.DataInput in,
byte idType) |
protected long |
readId(java.io.DataInput in,
byte idType) |
protected java.lang.String |
readString(java.io.DataInput in) |
java.lang.String |
toString() |
protected void |
writeId(java.io.DataOutput out,
long id,
byte idType) |
protected void |
writeString(java.io.DataOutput out,
java.lang.String string) |
abstract void |
writeTo(java.io.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 java.lang.String value
public byte getType()
public long getId()
public java.lang.String getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public abstract void writeTo(java.io.DataOutput out, byte idType) throws java.io.IOException
java.io.IOException
public abstract void readFrom(java.io.DataInput in, byte idType) throws java.io.IOException
java.io.IOException
protected void writeId(java.io.DataOutput out, long id, byte idType) throws java.io.IOException
java.io.IOException
protected void writeString(java.io.DataOutput out, java.lang.String string) throws java.io.IOException
java.io.IOException
protected long readId(java.io.DataInput in, byte idType) throws java.io.IOException
java.io.IOException
protected java.lang.String readString(java.io.DataInput in) throws java.io.IOException
java.io.IOException
Copyright © 2004–2024 XStream. All rights reserved.