21 package org.opensplice.dds.sub;
23 import java.lang.reflect.Field;
30 import DDS.SampleInfoSeqHolder;
39 private int currentIndex;
40 private int initUntil;
44 Field dataSeqHolderValue, SampleInfoSeqHolder infoSeqHolder) {
50 this.currentIndex = 0;
58 protected abstract TYPE
getData(
int index);
62 if (this.currentIndex == -1) {
64 "Iterator already closed.");
66 if (infoSeqHolder.value.length >
this.currentIndex) {
74 if (this.currentIndex == -1) {
76 "Iterator already closed.");
78 if ((this.currentIndex - 1) > 0) {
86 if (this.currentIndex == -1) {
88 "Iterator already closed.");
90 return this.currentIndex;
95 if (this.currentIndex == -1) {
97 "Iterator already closed.");
99 return this.currentIndex - 1;
104 if (this.currentIndex == -1) {
106 "Iterator already closed.");
108 this.currentIndex = -1;
109 this.reader.
returnLoan(this.sampleSeqHolder, this.infoSeqHolder);
114 public void remove() {
116 "Cannot remove() from Sample.Iterator.");
122 "Cannot set() in Sample.Iterator.");
128 "Cannot add() to Sample.Iterator.");
133 if (this.currentIndex == -1) {
135 "Iterator already closed.");
137 int index = this.currentIndex++;
139 if (this.initUntil < index) {
141 this.
getData(index), this.infoSeqHolder.value[index]);
144 return this.samples[index];
149 if (this.currentIndex == -1) {
151 "Iterator already closed.");
153 return this.samples[--this.currentIndex];
final OsplServiceEnvironment environment
A Sample represents an atom of data information (i.e., one value for one instance) as returned by a o...
abstract SampleImpl< TYPE > [] setupSampleList()
abstract TYPE getData(int index)
final AbstractDataReader< TYPE > reader
void deregisterIterator(AbstractIterator< TYPE > iterator)
final Object sampleSeqHolder
void add(Sample< TYPE > o)
final SampleInfoSeqHolder infoSeqHolder
AbstractIterator(OsplServiceEnvironment environment, AbstractDataReader< TYPE > reader, Object sampleSeqHolder, Field dataSeqHolderValue, SampleInfoSeqHolder infoSeqHolder)
void returnLoan(Object sampleSeqHolder, DDS.SampleInfoSeqHolder infoSeqHolder)
final Field dataSeqHolderValue
void registerIterator(AbstractIterator< TYPE > iterator)
Sample< TYPE > previous()