public <K extends FieldValue, V extends FieldValue> void write(FieldBase field, MapFieldValue<K, V> map) { buf.putInt1_2_4Bytes(map.size()); for (Map.Entry<K, V> e : map.entrySet()) { e.getKey().serialize(this); e.getValue().serialize(this); } }
int spanNodeId = annotation.getSpanNode().getScratchId(); if (spanNodeId >= 0) { buf.putInt1_2_4Bytes(spanNodeId); } else { throw new SerializationException("Could not serialize annotation, associated SpanNode not found (" + annotation + ")");
public <K extends FieldValue, V extends FieldValue> void write(FieldBase field, MapFieldValue<K, V> map) { buf.putInt1_2_4Bytes(map.size()); for (Map.Entry<K, V> e : map.entrySet()) { e.getKey().serialize(this); e.getValue().serialize(this); } }
int spanNodeId = annotation.getSpanNode().getScratchId(); if (spanNodeId >= 0) { buf.putInt1_2_4Bytes(spanNodeId); } else { throw new SerializationException("Could not serialize annotation, associated SpanNode not found (" + annotation + ")");
public void write(Span span) { buf.put(Span.ID); if (bytePositions != null) { int byteFrom = bytePositions[span.getFrom()]; int byteLength = bytePositions[span.getFrom() + span.getLength()] - byteFrom; buf.putInt1_2_4Bytes(byteFrom); buf.putInt1_2_4Bytes(byteLength); } else { throw new SerializationException("Cannot serialize Span " + span + ", no access to parent StringFieldValue."); } }
public void write(SpanList spanList) { buf.put(SpanList.ID); buf.putInt1_2_4Bytes(spanList.numChildren()); Iterator<SpanNode> children = spanList.childIterator(); while (children.hasNext()) { write(children.next()); } }
public void write(Span span) { buf.put(Span.ID); if (bytePositions != null) { int byteFrom = bytePositions[span.getFrom()]; int byteLength = bytePositions[span.getFrom() + span.getLength()] - byteFrom; buf.putInt1_2_4Bytes(byteFrom); buf.putInt1_2_4Bytes(byteLength); } else { throw new SerializationException("Cannot serialize Span " + span + ", no access to parent StringFieldValue."); } }
public void write(SpanList spanList) { buf.put(SpanList.ID); buf.putInt1_2_4Bytes(spanList.numChildren()); Iterator<SpanNode> children = spanList.childIterator(); while (children.hasNext()) { write(children.next()); } }
public void write(FieldBase field, AnnotationReference value) { int annotationId = value.getReference().getScratchId(); if (annotationId >= 0) { buf.putInt1_2_4Bytes(annotationId); } else { throw new SerializationException("Could not serialize AnnotationReference value, reference not found (" + value + ")"); } }
public void write(AlternateSpanList altSpanList) { buf.put(AlternateSpanList.ID); buf.putInt1_2_4Bytes(altSpanList.getNumSubTrees()); for (int i = 0; i < altSpanList.getNumSubTrees(); i++) { buf.putDouble(altSpanList.getProbability(i)); buf.putInt1_2_4Bytes(altSpanList.numChildren(i)); Iterator<SpanNode> children = altSpanList.childIterator(i); while (children.hasNext()) { write(children.next()); } } }
public void write(FieldBase field, AnnotationReference value) { int annotationId = value.getReference().getScratchId(); if (annotationId >= 0) { buf.putInt1_2_4Bytes(annotationId); } else { throw new SerializationException("Could not serialize AnnotationReference value, reference not found (" + value + ")"); } }
/** * Write out the value of array field * * @param field - field description (name and data type) * @param array - field value */ public <T extends FieldValue> void write(FieldBase field, Array<T> array) { buf.putInt1_2_4Bytes(array.size()); List<T> lst = array.getValues(); for (FieldValue value : lst) { value.serialize(this); } }
public void write(AlternateSpanList altSpanList) { buf.put(AlternateSpanList.ID); buf.putInt1_2_4Bytes(altSpanList.getNumSubTrees()); for (int i = 0; i < altSpanList.getNumSubTrees(); i++) { buf.putDouble(altSpanList.getProbability(i)); buf.putInt1_2_4Bytes(altSpanList.numChildren(i)); Iterator<SpanNode> children = altSpanList.childIterator(i); while (children.hasNext()) { write(children.next()); } } }
/** * Write out the value of array field * * @param field - field description (name and data type) * @param array - field value */ public <T extends FieldValue> void write(FieldBase field, Array<T> array) { buf.putInt1_2_4Bytes(array.size()); List<T> lst = array.getValues(); for (FieldValue value : lst) { value.serialize(this); } }
buf.putInt1_2_4Bytes(tmpAnnotationList.size()); for (Annotation annotation : tmpAnnotationList) { write(annotation);
buf.putInt1_2_4Bytes(tmpAnnotationList.size()); for (Annotation annotation : tmpAnnotationList) { write(annotation);
buf.putInt1_2_4Bytes(trees.size());
buf.putInt1_2_4Bytes(trees.size());