Class ParseToken
java.lang.Object
org.orekit.files.ccsds.utils.lexical.ParseToken
Token occurring during CCSDS file parsing.
Parse tokens correspond to:
- bloc or entry start
- entry content
- bloc or entry end
- raw lines
- Since:
- 11.0
- Author:
- Luc Maisonobe
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface representing instance methods that consume boolean values.static interfaceInterface representing instance methods that consume center values.static interfaceInterface representing instance methods that consume center lists.static interfaceInterface representing instance methods that consume character values.static interfaceInterface representing instance methods that consume date values.static interfaceInterface representing instance methods that consume double array.static interfaceInterface representing instance methods that consume double values.static interfaceInterface representing instance methods that consume doubly-indexed double values.static interfaceParseToken.EnumConsumer<T extends Enum<T>>Interface representing instance methods that consume enum values.static interfaceParseToken.EnumListConsumer<T extends Enum<T>>Interface representing instance methods that consume lists of enum values.static interfaceInterface representing instance methods that consume frame values.static interfaceInterface representing instance methods that consume indexed double array values.static interfaceInterface representing instance methods that consume indexed double values.static interfaceInterface representing instance methods that consume indexed integer values.static interfaceInterface representing instance methods that consume indexed string values.static interfaceInterface representing instance methods that consume integer values.static interfaceInterface representing instance methods that consume integer array.static interfaceInterface representing instance methods that consume labeled double values.static interfaceInterface representing instance methods that consume Maneuvrable values.static interfaceInterface representing instance methods that consume otation order values.static interfaceInterface representing instance methods that consume string values.static interfaceInterface representing instance methods that consume lists of strings values.static interfaceInterface representing instance methods that consume time systems values.static interfaceInterface representing instance methods that consume units lists values.static interfaceInterface representing instance methods that consume vector values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateException(Exception cause) Generate a parse exception for this entry.booleanGet the content of the entry as a boolean.doubleGet the content of the entry as a double.<T extends Enum<T>>
TgetContentAsEnum(Class<T> cls) Get the content of the entry as an enum.getContentAsEnumList(Class<T> cls) Get the content of the entry as a list of enum.Get the content of the entry as a list of free-text strings.intGet the content of the entry as an integer.Get the content of the entry as a list of normalized strings.Get the content of the entry.charGet the content of the entry as an uppercase character.Get the content of the entry as a list of normalized and uppercased strings.Get the content of the entry as normalized and uppercased.Get the content of the entry as a vector.Get the name of the file.intGet the number of the line in the CCSDS data message.getName()Get the name of the block or entry.Get the raw content of the entry.getType()Get the type of the token.getUnits()Get the units.booleanprocessAsBoolean(ParseToken.BooleanConsumer consumer) Process the content as a boolean.booleanprocessAsCenter(ParseToken.CenterConsumer consumer, CelestialBodies celestialBodies) Process the content as a body center.booleanprocessAsCenterList(ParseToken.CenterListConsumer consumer, CelestialBodies celestialBodies) Process the content as a body center list.booleanprocessAsDate(ParseToken.DateConsumer consumer, ContextBinding context) Process the content as a date.booleanprocessAsDouble(Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoubleConsumer consumer) Process the content as a double.booleanprocessAsDoubleArray(Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoubleArrayConsumer consumer) Process the content as an array of doubles.booleanprocessAsDoublyIndexedDouble(int i, int j, Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoublyIndexedDoubleConsumer consumer) Process the content as a doubly-indexed double.<T extends Enum<T>>
booleanprocessAsEnum(Class<T> cls, ParseToken.EnumConsumer<T> consumer) Process the content as an enum.<T extends Enum<T>>
booleanprocessAsEnumsList(Class<T> cls, ParseToken.EnumListConsumer<T> consumer) Process the content as a list of enums.booleanprocessAsFrame(ParseToken.FrameConsumer consumer, ContextBinding context, boolean allowCelestial, boolean allowOrbit, boolean allowSpacecraft) Process the content as a frame.booleanProcess the content as a list of free-text strings.booleanProcess the content as free text string.booleanprocessAsIndexedDouble(int i, Unit standard, ParsedUnitsBehavior behavior, ParseToken.IndexedDoubleConsumer consumer) Process the content as an indexed double.booleanprocessAsIndexedDoubleArray(int index, Unit standard, ParsedUnitsBehavior behavior, ParseToken.IndexedDoubleArrayConsumer consumer) Process the content as an indexed double array.booleanprocessAsIndexedInteger(int index, ParseToken.IndexedIntConsumer consumer) Process the content as an indexed integer.booleanprocessAsIndexedNormalizedString(int index, ParseToken.IndexedStringConsumer consumer) Process the content as an indexed normalized string.booleanprocessAsIndexedUppercaseString(int index, ParseToken.IndexedStringConsumer consumer) Process the content as an indexed normalized uppercase string.booleanprocessAsInteger(ParseToken.IntConsumer consumer) Process the content as an integer.booleanProcess the content as an array of integers.booleanProcess the content as an array of integers.booleanprocessAsLabeledDouble(char label, Unit standard, ParsedUnitsBehavior behavior, ParseToken.LabeledDoubleConsumer consumer) Process the content as a labeled double.booleanProcess the content of the Maneuvrable enum.booleanProcess the content as a normalized character.booleanProcess the content as a list of normalized strings.booleanProcess the content as a normalized string.booleanProcess the content as a rotation sequence.booleanProcess the content as a time system.booleanprocessAsUnitList(ParseToken.UnitListConsumer consumer) Process the content as a list of units.booleanProcess the content as a list of normalized uppercase strings.booleanProcess the content as a normalized uppercase string.booleanprocessAsVector(Unit standard, ParsedUnitsBehavior behavior, ParseToken.VectorConsumer consumer) Process the content as a vector.
-
Constructor Details
-
ParseToken
public ParseToken(TokenType type, String name, String content, Unit units, int lineNumber, String fileName) Simple constructor.- Parameters:
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 file
-
-
Method Details
-
getType
Get the type of the token.- Returns:
- type of the token
-
getName
Get the name of the block or entry.- Returns:
- name of the block or entry
-
getRawContent
Get the raw content of the entry.- Returns:
- entry raw content
-
getContentAsNormalizedString
Get the content of the entry.Free-text strings are normalized by replacing all occurrences of '_' with space, and collapsing several spaces as one space only.
- Returns:
- entry content
-
getContentAsFreeTextList
Get the content of the entry as a list of free-text strings.- Returns:
- content of the entry as a list of free-test strings
- Since:
- 12.0
-
getContentAsNormalizedList
Get the content of the entry as a list of normalized strings.Normalization is performed by replacing all occurrences of '_' with space, and collapsing several spaces as one space only.
- Returns:
- content of the entry as a list of free-test strings
-
getContentAsUppercaseString
Get the content of the entry as normalized and uppercased.- Returns:
- entry normalized and uppercased content
-
getContentAsUppercaseList
Get the content of the entry as a list of normalized and uppercased strings.- Returns:
- content of the entry as a list of normalized and uppercased strings
-
getContentAsEnum
Get the content of the entry as an enum.- Type Parameters:
T- type of the enum- Parameters:
cls- enum class- Returns:
- entry content
-
getContentAsEnumList
Get the content of the entry as a list of enum.- Type Parameters:
T- type of the enum- Parameters:
cls- enum class- Returns:
- entry content
-
getContentAsDouble
public double getContentAsDouble()Get the content of the entry as a double.- Returns:
- content as a double
-
getContentAsVector
Get the content of the entry as a vector.- Returns:
- content as a vector
-
getContentAsBoolean
public boolean getContentAsBoolean()Get the content of the entry as a boolean.- Returns:
- content as a boolean
-
getContentAsInt
public int getContentAsInt()Get the content of the entry as an integer.- Returns:
- content as an integer
-
getContentAsUppercaseCharacter
public char getContentAsUppercaseCharacter()Get the content of the entry as an uppercase character.- Returns:
- content as an uppercase character
-
getUnits
Get the units.- Returns:
- units of the entry (may be null)
-
getLineNumber
public int getLineNumber()Get the number of the line in the CCSDS data message.- Returns:
- number of the line in the CCSDS data message
-
getFileName
Get the name of the file.- Returns:
- name of the file
-
processAsNormalizedString
Process the content as a normalized string.- Parameters:
consumer- consumer of the normalized string- Returns:
- always returns
true - See Also:
-
processAsUppercaseString
Process the content as a normalized uppercase string.- Parameters:
consumer- consumer of the normalized uppercase string- Returns:
- always returns
true - See Also:
-
processAsIndexedNormalizedString
public boolean processAsIndexedNormalizedString(int index, ParseToken.IndexedStringConsumer consumer) Process the content as an indexed normalized string.- Parameters:
index- indexconsumer- consumer of the indexed normalized string- Returns:
- always returns
true
-
processAsIndexedUppercaseString
public boolean processAsIndexedUppercaseString(int index, ParseToken.IndexedStringConsumer consumer) Process the content as an indexed normalized uppercase string.- Parameters:
index- indexconsumer- consumer of the indexed normalized uppercase string- Returns:
- always returns
true
-
processAsFreeTextList
Process the content as a list of free-text strings.- Parameters:
consumer- consumer of the free-text strings list- Returns:
- always returns
true - Since:
- 12.0
-
processAsNormalizedList
Process the content as a list of normalized strings.- Parameters:
consumer- consumer of the normalized strings list- Returns:
- always returns
true
-
processAsUppercaseList
Process the content as a list of normalized uppercase strings.- Parameters:
consumer- consumer of the normalized uppercase strings list- Returns:
- always returns
true
-
processAsEnum
Process the content as an enum.- Type Parameters:
T- type of the enum- Parameters:
cls- enum classconsumer- consumer of the enum- Returns:
- always returns
true
-
processAsEnumsList
public <T extends Enum<T>> boolean processAsEnumsList(Class<T> cls, ParseToken.EnumListConsumer<T> consumer) Process the content as a list of enums.- Type Parameters:
T- type of the enum- Parameters:
cls- enum classconsumer- consumer of the enums list- Returns:
- always returns
true
-
processAsBoolean
Process the content as a boolean.- Parameters:
consumer- consumer of the boolean- Returns:
- always returns
true
-
processAsInteger
Process the content as an integer.- Parameters:
consumer- consumer of the integer- Returns:
- always returns
true
-
processAsIndexedInteger
Process the content as an indexed integer.- Parameters:
index- indexconsumer- consumer of the integer- Returns:
- always returns
true - Since:
- 12.0
-
processAsIntegerArrayNoSpace
Process the content as an array of integers. No spaces between commas are allowed.- Parameters:
consumer- consumer of the array- Returns:
- always returns
true
-
processAsIntegerArray
Process the content as an array of integers. Spaces are replaced by commas.- Parameters:
consumer- consumer of the array- Returns:
- always returns
true
-
processAsNormalizedCharacter
Process the content as a normalized character.- Parameters:
consumer- consumer of the normalized character- Returns:
- always returns
true
-
processAsDouble
public boolean processAsDouble(Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoubleConsumer consumer) Process the content as a double.- Parameters:
standard- units of parsed content as specified by CCSDS standardbehavior- behavior to adopt for parsed unitconsumer- consumer of the double- Returns:
- always returns
true
-
processAsLabeledDouble
public boolean processAsLabeledDouble(char label, Unit standard, ParsedUnitsBehavior behavior, ParseToken.LabeledDoubleConsumer consumer) Process the content as a labeled double.- Parameters:
label- labelstandard- units of parsed content as specified by CCSDS standardbehavior- behavior to adopt for parsed unitconsumer- consumer of the indexed double- Returns:
- always returns
true
-
processAsIndexedDouble
public boolean processAsIndexedDouble(int i, Unit standard, ParsedUnitsBehavior behavior, ParseToken.IndexedDoubleConsumer consumer) Process the content as an indexed double.- Parameters:
i- indexstandard- units of parsed content as specified by CCSDS standardbehavior- behavior to adopt for parsed unitconsumer- consumer of the indexed double- Returns:
- always returns
true
-
processAsDoublyIndexedDouble
public boolean processAsDoublyIndexedDouble(int i, int j, Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoublyIndexedDoubleConsumer consumer) Process the content as a doubly-indexed double.- Parameters:
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 double- Returns:
- always returns
true
-
processAsDoubleArray
public boolean processAsDoubleArray(Unit standard, ParsedUnitsBehavior behavior, ParseToken.DoubleArrayConsumer consumer) Process the content as an array of doubles.- Parameters:
standard- units of parsed content as specified by CCSDS standardbehavior- behavior to adopt for parsed unitconsumer- consumer of the array- Returns:
- always returns
true - Since:
- 12.0
-
processAsIndexedDoubleArray
public boolean processAsIndexedDoubleArray(int index, Unit standard, ParsedUnitsBehavior behavior, ParseToken.IndexedDoubleArrayConsumer consumer) Process the content as an indexed double array.- Parameters:
index- indexstandard- units of parsed content as specified by CCSDS standardbehavior- behavior to adopt for parsed unitconsumer- consumer of the indexed double array- Returns:
- always returns
true - Since:
- 12.0
-
processAsVector
public boolean processAsVector(Unit standard, ParsedUnitsBehavior behavior, ParseToken.VectorConsumer consumer) Process the content as a vector.- Parameters:
standard- units of parsed content as specified by CCSDS standardbehavior- behavior to adopt for parsed unitconsumer- consumer of the vector- Returns:
- always returns
true(or throws an exception)
-
processAsDate
Process the content as a date.- Parameters:
consumer- consumer of the datecontext- context binding- Returns:
- always returns
true(or throws an exception)
-
processAsTimeSystem
Process the content as a time system.- Parameters:
consumer- consumer of the time system- Returns:
- always returns
true(or throws an exception)
-
processAsFrame
public boolean processAsFrame(ParseToken.FrameConsumer consumer, ContextBinding context, boolean allowCelestial, boolean allowOrbit, boolean allowSpacecraft) Process the content as a frame.- Parameters:
consumer- consumer of the framecontext- context bindingallowCelestial- if true,CelestialBodyFrameare allowedallowOrbit- if true,OrbitRelativeFrameare allowedallowSpacecraft- if true,SpacecraftBodyFrameare allowed- Returns:
- always returns
true
-
processAsCenter
Process the content as a body center.- Parameters:
consumer- consumer of the body centercelestialBodies- factory for celestial bodies- Returns:
- always returns
true
-
processAsCenterList
public boolean processAsCenterList(ParseToken.CenterListConsumer consumer, CelestialBodies celestialBodies) Process the content as a body center list.- Parameters:
consumer- consumer of the body center listcelestialBodies- factory for celestial bodies- Returns:
- always returns
true
-
processAsRotationOrder
Process the content as a rotation sequence.- Parameters:
consumer- consumer of the rotation sequence- Returns:
- always returns
true - Since:
- 12.0
-
processAsUnitList
Process the content as a list of units.- Parameters:
consumer- consumer of the time scale- Returns:
- always returns
true(or throws an exception)
-
processAsFreeTextString
Process the content as free text string.- Parameters:
consumer- consumer of the string- Returns:
- always returns
true
-
processAsManeuvrableEnum
Process the content of the Maneuvrable enum.- Parameters:
consumer- consumer of the enum- Returns:
- always returns
true
-
generateException
Generate a parse exception for this entry.- Parameters:
cause- underlying cause exception (may be null)- Returns:
- exception for this entry
-