public interface IonDatagram extends IonSequence
WARNING: This interface should not be implemented or extended by code outside of this library. Some inherited methods are not yet implemented or are unsupported for datagrams.
Along with the normal user values, datagrams contain system values, notably
the symbol table(s) used to atomize all symbols. Most uses of a datagram
will not see system values,
but applications that need visibility into that data can use the
system*() methods.
EMPTY_ARRAY| Modifier and Type | Method and Description |
|---|---|
ValueFactory |
add(int index)
This inherited method is not yet supported by datagrams.
|
void |
add(int index,
IonValue element)
This inherited method is not yet supported by datagrams.
|
boolean |
addAll(int index,
Collection<? extends IonValue> c)
This inherited method is not yet supported by datagrams.
|
void |
addTypeAnnotation(String annotation)
This inherited method is not supported by datagrams.
|
int |
byteSize()
Gets the number of bytes used to encode this datagram.
|
IonDatagram |
clone()
Creates a copy of this value and all of its children.
|
IonValue |
get(int index)
Gets a selected non-system element from this datagram.
|
byte[] |
getBytes()
Copies the binary-encoded form of this datagram into a new byte array.
|
int |
getBytes(OutputStream out)
Copies the binary-encoded form of this datagram to a specified stream.
|
IonContainer |
getContainer()
Gets the container of this value,
or
null if this is not part of one. |
SymbolTable |
getSymbolTable()
This inherited method is not supported by datagrams because there's no
single symbol table used across the contents.
|
boolean |
isNullValue()
Returns
false at every call, since datagrams cannot be null. |
Iterator<IonValue> |
iterator()
Creates an iterator providing the (direct) elements of this datagram.
|
void |
makeNull()
This inherited method is not supported by datagrams.
|
boolean |
retainAll(Collection<?> c)
This inherited method is not yet supported by datagrams.
|
IonValue |
set(int index,
IonValue element)
This inherited method is not yet supported by datagrams.
|
int |
size()
Gets the number of elements in the datagram, not counting system
elements.
|
IonValue |
systemGet(int index)
Gets a selected element from this datagram, potentially getting a
hidden system element (such as a symbol table).
|
ListIterator<IonValue> |
systemIterator()
Iterate all values in the datagram, including the otherwise-hidden
system values such as version markers and symbol tables.
|
int |
systemSize()
Gets the number of elements in the datagram, including system elements
such as version markers and symbol tables.
|
add, add, addAll, contains, containsAll, extract, indexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, subList, toArray, toArrayclear, isEmpty, removeaccept, clearTypeAnnotations, equals, getFieldName, getFieldNameSymbol, getSystem, getType, getTypeAnnotations, getTypeAnnotationSymbols, hashCode, hasTypeAnnotation, isReadOnly, makeReadOnly, removeFromContainer, removeTypeAnnotation, setTypeAnnotations, setTypeAnnotationSymbols, topLevelValue, toPrettyString, toString, toString, writeToclear, equals, hashCode, isEmpty, replaceAll, sort, spliteratorparallelStream, removeIf, streamvoid add(int index,
IonValue element)
throws ContainedValueException,
NullPointerException
Vote for issue amznlabs/ion-java#48 if you need this.
add in interface IonSequenceadd in interface List<IonValue>element - is the element to be appended to this sequence.UnsupportedOperationException - at every call.ContainedValueException - if child is already part of a container.NullPointerException - if child is null.ValueFactory add(int index) throws ContainedValueException, NullPointerException
Vote for issue amznlabs/ion-java#48 if you need this.
add in interface IonSequenceUnsupportedOperationException - at every call.ContainedValueExceptionNullPointerExceptionboolean addAll(int index,
Collection<? extends IonValue> c)
Vote for issue amznlabs/ion-java#47 if you need this.
addAll in interface IonSequenceaddAll in interface List<IonValue>index - index at which to insert first element from the specified collection.c - elements to be inserted into this sequence.true if this sequence changed as a result of the call.UnsupportedOperationException - at every call.IonValue set(int index, IonValue element)
Vote for issue amznlabs/ion-java#50 if you need this.
set in interface IonSequenceset in interface List<IonValue>index - index of the element to replace.element - element to be stored at the specified position.UnsupportedOperationException - at every call.boolean isNullValue()
false at every call, since datagrams cannot be null.isNullValue in interface IonValuefalseIonContainer getContainer()
null if this is not part of one.
Datagrams always return null from this method, since by
definition they have no container.
getContainer in interface IonValueint size()
size in interface Collection<IonValue>size in interface IonContainersize in interface List<IonValue>this.isNullValue().int systemSize()
size() instead.size()IonValue get(int index) throws IndexOutOfBoundsException
get in interface IonSequenceget in interface List<IonValue>index - must be less than size().null.IndexOutOfBoundsException - if the index is bad.IonValue systemGet(int index) throws IndexOutOfBoundsException
get(int) instead.index - must be less than systemSize().null.IndexOutOfBoundsException - if the index is bad.get(int)Iterator<IonValue> iterator()
This iterator returns only user values, ignoring symbol tables and other
system values. It does not support the Iterator.remove()
operation.
iterator in interface Collection<IonValue>iterator in interface IonContaineriterator in interface Iterable<IonValue>iterator in interface List<IonValue>null.systemIterator()ListIterator<IonValue> systemIterator()
iterator() instead.
This iterator does not support the modification methods
Iterator.remove(), ListIterator.add(Object), or
ListIterator.set(Object).
iterator()int byteSize()
throws IonException
IonException - if there's an error encoding the data.byte[] getBytes()
throws IonException
IonException - if there's an error encoding the data.int getBytes(OutputStream out) throws IOException, IonException
out - the output stream to which to write the data.IonException - if there's an error encoding the data.IOException - if an error occurs writing the data to the stream.SymbolTable getSymbolTable()
getSymbolTable in interface IonValueUnsupportedOperationException - at every call.void addTypeAnnotation(String annotation)
addTypeAnnotation in interface IonValueannotation - as a string value.UnsupportedOperationException - at every call.void makeNull()
makeNull in interface IonContainerUnsupportedOperationException - at every call.boolean retainAll(Collection<?> c)
Vote for SIM issue amznlabs/ion-java#49 if you need this.
retainAll in interface Collection<IonValue>retainAll in interface IonSequenceretainAll in interface List<IonValue>true if this sequence changed as a result of the call.UnsupportedOperationException - at every call.IonDatagram clone() throws UnknownSymbolException
IonValueIonValue.isReadOnly().
The cloned value will be created in the context of the same
ValueFactory as this instance; if you want a copy using a
different factory, then use ValueFactory.clone(IonValue)
instead.
clone in interface IonContainerclone in interface IonSequenceclone in interface IonValueUnknownSymbolException - if any part of this value has unknown text but known Sid for
its field name, annotation or symbol.