use of com.amazon.ion.IonValue in project ion-java by amzn.
the class IonDatagramLite method systemGet.
// TODO: optimize this, if there's a real use case
// deprecate this is there isn't (which I suspect is actually the case)
public IonValue systemGet(int index) throws IndexOutOfBoundsException {
ListIterator<IonValue> iterator = systemIterator();
IonValue value = null;
if (index < 0) {
throw new IndexOutOfBoundsException("" + index);
}
int ii;
for (ii = 0; ii <= index; ii++) {
if (!iterator.hasNext()) {
throw new IndexOutOfBoundsException("" + index);
}
value = iterator.next();
}
return value;
}
use of com.amazon.ion.IonValue in project ion-java by amzn.
the class IonDatagramLite method systemSize.
// TODO: optimize this, if there's a real use case
// deprecate this is there isn't (which I suspect is actually the case)
public int systemSize() {
int count = 0;
ListIterator<IonValue> iterator = systemIterator();
while (iterator.hasNext()) {
@SuppressWarnings("unused") IonValue value = iterator.next();
count++;
}
return count;
}
use of com.amazon.ion.IonValue in project ion-java by amzn.
the class IonReaderTextSystemX method fillContainerStruct.
private final void fillContainerStruct(IonSystem sys, IonStruct struct) {
this.stepIn();
while (this.next() != null) {
String name = this.getFieldName();
IonValue v = this.getIonValue(sys);
struct.add(name, v);
}
this.stepOut();
}
use of com.amazon.ion.IonValue in project ion-java by amzn.
the class IonWriterSystemTree method writeIonVersionMarkerAsIs.
@Override
void writeIonVersionMarkerAsIs(SymbolTable systemSymtab) throws IOException {
startValue();
IonValue root = get_root();
((_Private_IonDatagram) root).appendTrailingSymbolTable(systemSymtab);
endValue();
}
use of com.amazon.ion.IonValue in project ion-java by amzn.
the class IonWriterSystemTree method writeInt.
public void writeInt(long value) throws IOException {
IonValue v = _factory.newInt(value);
append(v);
}
Aggregations