public abstract class RecordSource extends Object implements DataIterator, SubscriptionIterator
RecordCursor
using next()
method. It supports navigation
to arbitrary records by their position via getPosition
, setPosition
, abd
cursorAt(long)
methods and, thus, can be read multiple times.
It can be sliced with newSource
method.
This abstract class is replacing legacy interfaces DataIterator
and SubscriptionIterator
.
Modifier and Type | Field and Description |
---|---|
static RecordSource |
VOID
An empty record source.
|
Modifier and Type | Method and Description |
---|---|
abstract RecordCursor |
current()
Returns read cursor at the current position.
|
abstract RecordCursor |
cursorAt(long position)
Returns read cursor at a specified position.
|
abstract int |
getCipher()
Deprecated.
Use
next() . |
abstract long |
getLimit()
Returns limit of this source,
which is the position of after the last record returned by
next() . |
abstract RecordMode |
getMode()
Returns mode of this record source.
|
abstract long |
getPosition()
Returns position of the current record.
|
abstract String |
getSymbol()
Deprecated.
Use
next() . |
abstract long |
getTime()
Deprecated.
Use
next() . |
abstract RecordSource |
newSource()
|
abstract RecordSource |
newSource(long start,
long end)
Returns new
RecordSource that reads this record source from
the specified start position to the specified end position. |
abstract RecordCursor |
next()
Returns read cursor at the current position and advances position to next record.
|
abstract int |
nextIntField()
Deprecated.
Use
next() . |
abstract Object |
nextObjField()
Deprecated.
Use
next() . |
abstract DataRecord |
nextRecord()
Deprecated.
Use
next() . |
abstract boolean |
retrieve(RecordSink sink)
Retrieves all records from
position to limit
into the given sink and advances position while the sink has capacity . |
abstract void |
setPosition(long position)
Changes position of the current record.
|
public static final RecordSource VOID
public abstract RecordMode getMode()
RecordCursor
mode
for the results of next()
, cursorAt(long)
, and current()
methods.public abstract boolean retrieve(RecordSink sink)
position
to limit
into the given sink and advances position while the sink has capacity
.sink
- the sink.true
if all data was retrieved,
false
if sink ran out of capacity and more records remain to retrieve.public abstract RecordCursor next()
null
when
position
is equal to limit
.
The mode of the resulting cursor is the same as returned by getMode()
.
public abstract RecordCursor cursorAt(long position)
getPosition()
or getLimit()
method.
Invoking this method at the current position
results in the same cursor as
the call current()
or call to next()
without the side effect of
advancing position.
The result of this method at the current limit
is null
.
The mode of the resulting cursor is the same as returned by getMode()
.
IndexOutOfBoundsException
- if position is invalid or above current limit.public abstract RecordCursor current()
cursorAt
(getPosition
())
, but faster.
It is the same as call to next()
without the side effect of
advancing position.
The mode of the resulting cursor is the same as returned by getMode()
.
public abstract long getPosition()
next()
method.public abstract void setPosition(long position)
getPosition()
, getLimit()
or next
().getPosition
()
methods are allowed here.position
- new position.IndexOutOfBoundsException
- if position is invalid or above current limit.public abstract long getLimit()
next()
.public abstract RecordSource newSource()
RecordSource
that reads this record source from
its current position
to its limit
.
It is equivalent to newSource(getPosition(), getLimit())
.newSource(long, long)
public abstract RecordSource newSource(long start, long end)
RecordSource
that reads this record source from
the specified start position to the specified end position.newSource()
public abstract int getCipher()
next()
.DataIterator.nextRecord()
.
Returns 0 if not encoded or if no current record is being iterated.getCipher
in interface DataIterator
getCipher
in interface SubscriptionIterator
public abstract String getSymbol()
next()
.DataIterator.nextRecord()
.
Returns null if encoded or if no current record is being iterated.getSymbol
in interface DataIterator
getSymbol
in interface SubscriptionIterator
public abstract DataRecord nextRecord()
next()
.nextRecord
in interface DataIterator
nextRecord
in interface SubscriptionIterator
public abstract int nextIntField()
next()
.nextIntField
in interface DataIterator
public abstract Object nextObjField()
next()
.nextObjField
in interface DataIterator
public abstract long getTime()
next()
.SubscriptionIterator.nextRecord()
.
Returns 0 if not historical or if no current record is being iterated.getTime
in interface SubscriptionIterator
Copyright © 2002–2025 Devexperts LLC. All rights reserved.