Search in sources :

Example 71 with IonValue

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;
}
Also used : IonValue(com.amazon.ion.IonValue)

Example 72 with IonValue

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;
}
Also used : IonValue(com.amazon.ion.IonValue)

Example 73 with IonValue

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();
}
Also used : IonValue(com.amazon.ion.IonValue)

Example 74 with IonValue

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();
}
Also used : IonValue(com.amazon.ion.IonValue)

Example 75 with IonValue

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);
}
Also used : IonValue(com.amazon.ion.IonValue)

Aggregations

IonValue (com.amazon.ion.IonValue)185 Test (org.junit.Test)115 IonSequence (com.amazon.ion.IonSequence)61 SymbolTable (com.amazon.ion.SymbolTable)21 IonDatagram (com.amazon.ion.IonDatagram)20 IonStruct (com.amazon.ion.IonStruct)18 IonInt (com.amazon.ion.IonInt)16 IOException (java.io.IOException)14 IonReader (com.amazon.ion.IonReader)13 IonSystem (com.amazon.ion.IonSystem)12 Result (software.amazon.qldb.Result)11 SymbolToken (com.amazon.ion.SymbolToken)10 ArrayList (java.util.ArrayList)10 IonString (com.amazon.ion.IonString)9 IonException (com.amazon.ion.IonException)7 IonType (com.amazon.ion.IonType)6 IonObjectMapper (com.fasterxml.jackson.dataformat.ion.IonObjectMapper)6 Event (com.amazon.tools.events.Event)5 com.amazon.ion.impl._Private_IonValue (com.amazon.ion.impl._Private_IonValue)4 EventType (com.amazon.tools.events.EventType)4