@Override public boolean hasNext() { return position + 1 < values.size(); }
public int size() { return context.size(); }
@Override public boolean hasNext() { return position + 1 < values.size(); }
public int size() { return context.size(); }
public int numResults() { return matchingPositions.size(); }
public boolean hasElements() { return context.size() > 0; }
public boolean hasElements() { return context.size() > 0; }
public int numResults() { return matchingPositions.size(); }
/** * Appends the passed element to the end of the list. * * @param srcBuffer from which the element bytes will be copied. * @param offset at which the element begins. * @param length of the element. */ public void add(DirectBuffer srcBuffer, int offset, int length) { add(srcBuffer, offset, length, max(size(), 0)); }
/** * Appends the passed element to the end of the list. * * @param srcBuffer from which the element bytes will be copied. * @param offset at which the element begins. * @param length of the element. */ public void add(DirectBuffer srcBuffer, int offset, int length) { add(srcBuffer, offset, length, max(size(), 0)); }
public void moveToLastElement() { context.wrap(context.size() - 1, cursorView); }
public void moveToLastElement() { context.wrap(context.size() - 1, cursorView); }
/** Removes all of the elements from this list. The list will be empty after this call returns. */ public void clear() { final int size = size(); final int start = elementOffset(framedElementLength, 0); final int end = framedElementLength * size; setMemory(start, end, (byte) 0); setSize(0); }
public void removeLastElement() { context.remove(context.size() - 1); if (size() > 0) { moveToLastElement(); } }
/** Removes all of the elements from this list. The list will be empty after this call returns. */ public void clear() { final int size = size(); final int start = elementOffset(framedElementLength, 0); final int end = framedElementLength * size; setMemory(start, end, (byte) 0); setSize(0); }
public void removeLastElement() { context.remove(context.size() - 1); if (size() > 0) { moveToLastElement(); } }
/** * Replaces the element at the specified position in this list with the specified element. * * @param idx of the element to replace * @param srcBuffer from which the element bytes will be copied. * @param offset at which the element begins. * @param length of the element. */ public void set(int idx, DirectBuffer srcBuffer, int offset, int length) { final int size = size(); elementLengthCheck(length); boundsCheckIncludingSize(idx, size); setValue(srcBuffer, offset, length, idx); }
/** * Replaces the element at the specified position in this list with the specified element. * * @param idx of the element to replace * @param srcBuffer from which the element bytes will be copied. * @param offset at which the element begins. * @param length of the element. */ public void set(int idx, DirectBuffer srcBuffer, int offset, int length) { final int size = size(); elementLengthCheck(length); boundsCheckIncludingSize(idx, size); setValue(srcBuffer, offset, length, idx); }
/** * Attach a view of the element to a {@link MutableDirectBuffer} for providing direct access. * * @param idx the element to attach. * @param dstBuffer to which the view of the element is attached. * @return the length of the attached element. */ public int wrap(int idx, MutableDirectBuffer dstBuffer) { final int size = size(); boundsCheckIncludingSize(idx, size); final int elementOffset = elementOffset(framedElementLength, idx); final int length = listBuffer.getInt(elementLengthOffset(elementOffset)); dstBuffer.wrap(listBuffer, elementDataOffset(elementOffset), length); return length; }
/** * Attach a view of the element to a {@link MutableDirectBuffer} for providing direct access. * * @param idx the element to attach. * @param dstBuffer to which the view of the element is attached. * @return the length of the attached element. */ public int wrap(int idx, MutableDirectBuffer dstBuffer) { final int size = size(); boundsCheckIncludingSize(idx, size); final int elementOffset = elementOffset(framedElementLength, idx); final int length = listBuffer.getInt(elementLengthOffset(elementOffset)); dstBuffer.wrap(listBuffer, elementDataOffset(elementOffset), length); return length; }