public class ParseToken extends Object
Parse tokens correspond to:
MessageParser
Modifier and Type | Class and Description |
---|---|
static interface |
ParseToken.BooleanConsumer
Interface representing instance methods that consume boolean values.
|
static interface |
ParseToken.CenterConsumer
Interface representing instance methods that consume center values.
|
static interface |
ParseToken.CenterListConsumer
Interface representing instance methods that consume center lists.
|
static interface |
ParseToken.CharConsumer
Interface representing instance methods that consume character values.
|
static interface |
ParseToken.DateConsumer
Interface representing instance methods that consume date values.
|
static interface |
ParseToken.DoubleConsumer
Interface representing instance methods that consume double values.
|
static interface |
ParseToken.DoublyIndexedDoubleConsumer
Interface representing instance methods that consume doubly-indexed double values.
|
static interface |
ParseToken.EnumConsumer<T extends Enum<T>>
Interface representing instance methods that consume enum values.
|
static interface |
ParseToken.EnumListConsumer<T extends Enum<T>>
Interface representing instance methods that consume lists of enum values.
|
static interface |
ParseToken.FrameConsumer
Interface representing instance methods that consume frame values.
|
static interface |
ParseToken.IndexedDoubleConsumer
Interface representing instance methods that consume indexed double values.
|
static interface |
ParseToken.IndexedStringConsumer
Interface representing instance methods that consume indexed string values.
|
static interface |
ParseToken.IntConsumer
Interface representing instance methods that consume integer values.
|
static interface |
ParseToken.IntegerArrayConsumer
Interface representing instance methods that consume integer array.
|
static interface |
ParseToken.LabeledDoubleConsumer
Interface representing instance methods that consume labeled double values.
|
static interface |
ParseToken.StringConsumer
Interface representing instance methods that consume string values.
|
static interface |
ParseToken.StringListConsumer
Interface representing instance methods that consume lists of strings values.
|
static interface |
ParseToken.TimeSystemConsumer
Interface representing instance methods that consume time systems values.
|
static interface |
ParseToken.UnitListConsumer
Interface representing instance methods that consume units lists values.
|
static interface |
ParseToken.VectorConsumer
Interface representing instance methods that consume vector values.
|
Constructor and Description |
---|
ParseToken(TokenType type,
String name,
String content,
Unit units,
int lineNumber,
String fileName)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
OrekitException |
generateException(Exception cause)
Generate a parse exception for this entry.
|
boolean |
getContentAsBoolean()
Get the content of the entry as a boolean.
|
double |
getContentAsDouble()
Get the content of the entry as a double.
|
<T extends Enum<T>> |
getContentAsEnum(Class<T> cls)
Get the content of the entry as an enum.
|
<T extends Enum<T>> |
getContentAsEnumList(Class<T> cls)
Get the content of the entry as a list of enum.
|
int |
getContentAsInt()
Get the content of the entry as an integer.
|
List<String> |
getContentAsNormalizedList()
Get the content of the entry as a list of free-text strings.
|
String |
getContentAsNormalizedString()
Get the content of the entry.
|
char |
getContentAsUppercaseCharacter()
Get the content of the entry as an uppercase character.
|
List<String> |
getContentAsUppercaseList()
Get the content of the entry as a list of normalized and uppercased strings.
|
String |
getContentAsUppercaseString()
Get the content of the entry as normalized and uppercased.
|
Vector3D |
getContentAsVector()
Get the content of the entry as a vector.
|
String |
getFileName()
Get the name of the file.
|
int |
getLineNumber()
Get the number of the line in the CCSDS data message.
|
String |
getName()
Get the name of the block or entry.
|
String |
getRawContent()
Get the raw content of the entry.
|
TokenType |
getType()
Get the type of the token.
|
Unit |
getUnits()
Get the units.
|
boolean |
processAsBoolean(ParseToken.BooleanConsumer consumer)
Process the content as a boolean.
|
boolean |
processAsCenter(ParseToken.CenterConsumer consumer,
CelestialBodies celestialBodies)
Process the content as a body center.
|
boolean |
processAsCenterList(ParseToken.CenterListConsumer consumer,
CelestialBodies celestialBodies)
Process the content as a body center list.
|
boolean |
processAsDate(ParseToken.DateConsumer consumer,
ContextBinding context)
Process the content as a date.
|
boolean |
processAsDouble(Unit standard,
ParsedUnitsBehavior behavior,
ParseToken.DoubleConsumer consumer)
Process the content as a double.
|
boolean |
processAsDoublyIndexedDouble(int i,
int j,
Unit standard,
ParsedUnitsBehavior behavior,
ParseToken.DoublyIndexedDoubleConsumer consumer)
Process the content as a doubly-indexed double.
|
<T extends Enum<T>> |
processAsEnum(Class<T> cls,
ParseToken.EnumConsumer<T> consumer)
Process the content as an enum.
|
<T extends Enum<T>> |
processAsEnumsList(Class<T> cls,
ParseToken.EnumListConsumer<T> consumer)
Process the content as a list of enums.
|
boolean |
processAsFrame(ParseToken.FrameConsumer consumer,
ContextBinding context,
boolean allowCelestial,
boolean allowOrbit,
boolean allowSpacecraft)
Process the content as a frame.
|
boolean |
processAsIndexedDouble(int i,
Unit standard,
ParsedUnitsBehavior behavior,
ParseToken.IndexedDoubleConsumer consumer)
Process the content as an indexed double.
|
boolean |
processAsIndexedNormalizedString(int index,
ParseToken.IndexedStringConsumer consumer)
Process the content as an indexed normalized string.
|
boolean |
processAsIndexedUppercaseString(int index,
ParseToken.IndexedStringConsumer consumer)
Process the content as an indexed normalized uppercase string.
|
boolean |
processAsInteger(ParseToken.IntConsumer consumer)
Process the content as an integer.
|
boolean |
processAsIntegerArray(ParseToken.IntegerArrayConsumer consumer)
Process the content as an array of integers.
|
boolean |
processAsLabeledDouble(char label,
Unit standard,
ParsedUnitsBehavior behavior,
ParseToken.LabeledDoubleConsumer consumer)
Process the content as an labeled double.
|
boolean |
processAsNormalizedCharacter(ParseToken.CharConsumer consumer)
Process the content as a normalized character.
|
boolean |
processAsNormalizedList(ParseToken.StringListConsumer consumer)
Process the content as a list of normalized strings.
|
boolean |
processAsNormalizedString(ParseToken.StringConsumer consumer)
Process the content as a normalized string.
|
boolean |
processAsTimeSystem(ParseToken.TimeSystemConsumer consumer)
Process the content as a time system.
|
boolean |
processAsUnitList(ParseToken.UnitListConsumer consumer)
Process the content as a list of units.
|
boolean |
processAsUppercaseList(ParseToken.StringListConsumer consumer)
Process the content as a list of normalized uppercase strings.
|
boolean |
processAsUppercaseString(ParseToken.StringConsumer consumer)
Process the content as a normalized uppercase string.
|
boolean |
processAsVector(ParseToken.VectorConsumer consumer)
Process the content as a vector.
|
public ParseToken(TokenType type, String name, String content, Unit units, int lineNumber, String fileName)
type
- type of the tokenname
- name of the block or entrycontent
- entry contentunits
- units of the entrylineNumber
- number of the line in the CCSDS data messagefileName
- name of the filepublic TokenType getType()
public String getName()
public String getRawContent()
public String getContentAsNormalizedString()
Free-text strings are normalized by replacing all occurrences of '_' with space, and collapsing several spaces as one space only.
public List<String> getContentAsNormalizedList()
Free-text strings are normalized by replacing all occurrences of '_' with space, and collapsing several spaces as one space only.
public String getContentAsUppercaseString()
public List<String> getContentAsUppercaseList()
public <T extends Enum<T>> T getContentAsEnum(Class<T> cls)
T
- type of the enumcls
- enum classpublic <T extends Enum<T>> List<T> getContentAsEnumList(Class<T> cls)
T
- type of the enumcls
- enum classpublic double getContentAsDouble()
public Vector3D getContentAsVector()
public boolean getContentAsBoolean()
public int getContentAsInt()
public char getContentAsUppercaseCharacter()
public Unit getUnits()
public int getLineNumber()
public String getFileName()
public boolean processAsNormalizedString(ParseToken.StringConsumer consumer)
consumer
- consumer of the normalized stringtrue
processAsUppercaseString(StringConsumer)
public boolean processAsUppercaseString(ParseToken.StringConsumer consumer)
consumer
- consumer of the normalized uppercase stringtrue
processAsNormalizedString(StringConsumer)
public boolean processAsIndexedNormalizedString(int index, ParseToken.IndexedStringConsumer consumer)
index
- indexconsumer
- consumer of the indexed normalized stringtrue
public boolean processAsIndexedUppercaseString(int index, ParseToken.IndexedStringConsumer consumer)
index
- indexconsumer
- consumer of the indexed normalized uppercase stringtrue
public boolean processAsNormalizedList(ParseToken.StringListConsumer consumer)
consumer
- consumer of the normalized strings listtrue
public boolean processAsUppercaseList(ParseToken.StringListConsumer consumer)
consumer
- consumer of the normalized uppercase strings listtrue
public <T extends Enum<T>> boolean processAsEnum(Class<T> cls, ParseToken.EnumConsumer<T> consumer)
T
- type of the enumcls
- enum classconsumer
- consumer of the enumtrue
public <T extends Enum<T>> boolean processAsEnumsList(Class<T> cls, ParseToken.EnumListConsumer<T> consumer)
T
- type of the enumcls
- enum classconsumer
- consumer of the enums listtrue
public boolean processAsBoolean(ParseToken.BooleanConsumer consumer)
consumer
- consumer of the booleantrue
public boolean processAsInteger(ParseToken.IntConsumer consumer)
consumer
- consumer of the integertrue
public boolean processAsIntegerArray(ParseToken.IntegerArrayConsumer consumer)
consumer
- consumer of the arraytrue
public boolean processAsNormalizedCharacter(ParseToken.CharConsumer consumer)
consumer
- consumer of the normalized charactertrue
public boolean processAsDouble(Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoubleConsumer consumer)
standard
- units of parsed content as specified by CCSDS standardbehavior
- behavior to adopt for parsed unitconsumer
- consumer of the doubletrue
public boolean processAsLabeledDouble(char label, Unit standard, ParsedUnitsBehavior behavior, ParseToken.LabeledDoubleConsumer consumer)
label
- labelstandard
- units of parsed content as specified by CCSDS standardbehavior
- behavior to adopt for parsed unitconsumer
- consumer of the indexed doubletrue
public boolean processAsIndexedDouble(int i, Unit standard, ParsedUnitsBehavior behavior, ParseToken.IndexedDoubleConsumer consumer)
i
- indexstandard
- units of parsed content as specified by CCSDS standardbehavior
- behavior to adopt for parsed unitconsumer
- consumer of the indexed doubletrue
public boolean processAsDoublyIndexedDouble(int i, int j, Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoublyIndexedDoubleConsumer consumer)
i
- first indexj
- second indexstandard
- units of parsed content as specified by CCSDS standardbehavior
- behavior to adopt for parsed unitconsumer
- consumer of the doubly-indexed doubletrue
public boolean processAsVector(ParseToken.VectorConsumer consumer)
consumer
- consumer of the vectortrue
(or throws an exception)public boolean processAsDate(ParseToken.DateConsumer consumer, ContextBinding context)
consumer
- consumer of the datecontext
- context bindingtrue
(or throws an exception)public boolean processAsTimeSystem(ParseToken.TimeSystemConsumer consumer)
consumer
- consumer of the time systemtrue
(or throws an exception)public boolean processAsFrame(ParseToken.FrameConsumer consumer, ContextBinding context, boolean allowCelestial, boolean allowOrbit, boolean allowSpacecraft)
consumer
- consumer of the framecontext
- context bindingallowCelestial
- if true, CelestialBodyFrame
are allowedallowOrbit
- if true, OrbitRelativeFrame
are allowedallowSpacecraft
- if true, SpacecraftBodyFrame
are allowedtrue
public boolean processAsCenter(ParseToken.CenterConsumer consumer, CelestialBodies celestialBodies)
consumer
- consumer of the body centercelestialBodies
- factory for celestial bodiestrue
public boolean processAsCenterList(ParseToken.CenterListConsumer consumer, CelestialBodies celestialBodies)
consumer
- consumer of the body center listcelestialBodies
- factory for celestial bodiestrue
public boolean processAsUnitList(ParseToken.UnitListConsumer consumer)
consumer
- consumer of the time scaletrue
(or throws an exception)public OrekitException generateException(Exception cause)
cause
- underlying cause exception (may be null)Copyright © 2002-2021 CS GROUP. All rights reserved.