Top Fields Constructors Methods
com.amazon.ion.impl

pack-priv final Class SymbolTokenImpl

extends Object
implements _Private_SymbolToken
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl._Private_SymbolToken, com.amazon.ion.SymbolToken
Imports
com.amazon.ion.SymbolToken, .UnknownSymbolException

Field Summary

Modifier and TypeField and Description
private final int
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
SymbolTokenImpl(String text, int sid)

pack-priv
SymbolTokenImpl(int sid)

Method Summary

Modifier and TypeMethod and Description
public String
assumeText()

Implements com.amazon.ion.SymbolToken.assumeText.

Gets the text of this symbol, throwing an exception if its unknown.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Implements com.amazon.ion.impl._Private_SymbolToken.equals.

Compares symboltokens for equality.

public int
getSid()

Implements com.amazon.ion.SymbolToken.getSid.

Gets the ID of this symbol token.

public String
getText()

Implements com.amazon.ion.SymbolToken.getText.

Gets the text of this symbol.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.amazon.ion.impl._Private_SymbolToken.hashCode.

Hashes the symboltoken for bucketing.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

mySidback to summary
private final int mySid
myTextback to summary
private final String myText

Constructor Detail

SymbolTokenImplback to summary
pack-priv SymbolTokenImpl(String text, int sid)
SymbolTokenImplback to summary
pack-priv SymbolTokenImpl(int sid)

Method Detail

assumeTextback to summary
public String assumeText()

Implements com.amazon.ion.SymbolToken.assumeText.

Doc from com.amazon.ion.SymbolToken.assumeText.

Gets the text of this symbol, throwing an exception if its unknown.

Returns:String

the text of the symbol, not null.

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements com.amazon.ion.impl._Private_SymbolToken.equals.

Doc from com.amazon.ion.impl._Private_SymbolToken.equals.

Compares symboltokens for equality.

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getSidback to summary
public int getSid()

Implements com.amazon.ion.SymbolToken.getSid.

Doc from com.amazon.ion.SymbolToken.getSid.

Gets the ID of this symbol token.

If no ID has yet been assigned (as may be the case when processing Ion text-formatted data), this method returns SymbolTable#UNKNOWN_SYMBOL_ID. In such cases getText() will be non-null.

Returns:int

the symbol ID (sid) of this symbol, or SymbolTable#UNKNOWN_SYMBOL_ID if the sid is unknown.

getTextback to summary
public String getText()

Implements com.amazon.ion.SymbolToken.getText.

Doc from com.amazon.ion.SymbolToken.getText.

Gets the text of this symbol.

If the text is not known (usually due to a shared symbol table being unavailable) then this method returns null. In such cases getSid() will be non-negative.

Returns:String

the text of this symbol, or null if the text is unknown.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements com.amazon.ion.impl._Private_SymbolToken.hashCode.

Doc from com.amazon.ion.impl._Private_SymbolToken.hashCode.

Hashes the symboltoken for bucketing.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override