public class FlatGroupReader extends Object implements Iterator<FlatGroupReader>
Constructor and Description |
---|
FlatGroupReader(FlatGroupReader other)
Copy constructor.
|
FlatGroupReader(GroupDefinition definition)
Constructs reader on the base of the group definition.
|
FlatGroupReader(Object... items)
Constructor with in-place dictionary.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int tag)
Returns whether the field with the specified tag number is set.
|
String |
get(int tag)
Returns the field value by the given tag.
|
BigDecimal |
getBigDecimal(int tag)
Returns the field value by the given tag.
|
char |
getChar(int tag)
Returns the field value by the given tag.
|
int |
getCurrentEntry()
Index of the current group entry.
|
double |
getDouble(int tag)
Returns the field value by the given tag.
|
HighResolutionTimestamp |
getHighResolutionTimestamp(int tag,
TimestampFormat format)
Returns the field value by the given tag.
|
int |
getInteger(int tag)
Returns the field value as integer.
|
long |
getLong(int tag)
Returns the field value by the given tag.
|
FlatMessage |
getMessage()
The wrapped message.
|
int |
getNumberOfInstances()
Returns number of entries in the repeating group.
|
FlatGroupReader |
getParent()
Gets parent accessor.
|
ScaledDecimal |
getScaledDecimal(int tag)
Returns the field value by the given tag.
|
LocalDateTime |
getUTCTimestamp(int tag)
Returns field value as
LocalDateTime . |
boolean |
hasNext()
Check whether the next entry available.
|
FlatGroupReader |
next()
Moves the accessor to the next entry.
|
void |
reset()
Resets the accessor to the state "before zeroth element" of the group.
|
void |
unwrap()
Detaches the reader from message or another reader.
|
boolean |
wrap(FlatGroupReader parentReader)
Attaches the accessor as nested group.
|
boolean |
wrap(FlatMessage message)
Attaches reader to the message as top-level group.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public FlatGroupReader(Object... items)
The constructor allows to create dictionary together with the accessor.
The dictionary will be built of the tags and subgroup dictionaries provided as arguments.
items
- Tags and subgroup dictionaries to be included into the reader's dictionary.public FlatGroupReader(GroupDefinition definition)
definition
- Group definition obtained from the FIX dictionary.public FlatGroupReader(FlatGroupReader other)
Duplicates state of the reader that is passed as the argument.
The dictionary used by the other
reader is shared with the reader being constructed
(even if the dictionary was generated specifically for the reader).
other
- Reader to copy state from.public FlatGroupReader getParent()
public void reset()
public boolean hasNext()
hasNext
in interface Iterator<FlatGroupReader>
public FlatGroupReader next()
next
in interface Iterator<FlatGroupReader>
NoSuchElementException
- when the sequence is ended.public int getCurrentEntry()
public int getNumberOfInstances()
public FlatMessage getMessage()
wrap(FlatMessage)
method.public boolean wrap(FlatMessage message)
This method attaches the accessor to the given message as an accessor to the top-level group.
message
- Message to use.true
if the message contains the group, false
otherwise.public boolean wrap(FlatGroupReader parentReader)
Attaches the accessor to another accessor to provide access to the nested group.
Please note that modifying state of the parent accessor invalidates state of the nested accessor.
parentReader
- Parent group.true
if the parentReader current entry contains the group, false
otherwise.public void unwrap()
This method detaches the reader from the message or another reader
that was previously attached using wrap(FlatMessage)
or wrap(FlatGroupReader)
methods.
public boolean contains(int tag)
tag
- field tag numbertrue
if the field is set,false
if the field is not set or is not defined for this messagepublic int getInteger(int tag)
contains(int)
.tag
- field tag numberInteger.MAX_VALUE
if it is not setValueIsIncorrectException
- if the value can't be parsed to intpublic long getLong(int tag)
tag
- field tagLong.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to longpublic char getChar(int tag)
tag
- field tagCharacter.MAX_VALUE
if it is not found.ValueIsIncorrectException
- if the value is not a charpublic double getDouble(int tag)
tag
- field tagDouble.NaN
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to doublepublic ScaledDecimal getScaledDecimal(int tag)
tag
- field tagnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to ScaledDecimal
public BigDecimal getBigDecimal(int tag)
tag
- field tagnull
if it is not found.ValueIsIncorrectException
- if the value can't be parsed to BigDecimal
public String get(int tag)
tag
- field tagnull
if it is not found.public HighResolutionTimestamp getHighResolutionTimestamp(int tag, TimestampFormat format)
tag
- field tagformat
- format to be used during parsingnull
if it is not found.ValueIsIncorrectException
- if the field value can't be parsed to HighResolutionTimestamp
with
specified TimestampFormat
formatpublic LocalDateTime getUTCTimestamp(int tag)
LocalDateTime
.tag
- field tag numbernull
if it is not availableValueIsIncorrectException
- if the field value can't be parsed to LocalDateTime
Copyright © 2005–2024 Onix Solutions. All rights reserved.