/** * enlarge the capacity if necessary, to ensure that it can hold the number of * elements specified by newValidCapacity argument. It will also narrow the * valid capacity when needed. Notice: it only enlarge or narrow the valid * capacity with no care of the already stored invalid BytesRefWritable. * * @param newValidCapacity * the desired capacity */ public void resetValid(int newValidCapacity) { ensureCapacity(newValidCapacity); valid = newValidCapacity; }
/** * Set the BytesRefWritable at the specified position with the specified * BytesRefWritable. * * @param index * index position * @param bytesRefWritable * the new element * @throws IllegalArgumentException * if the specified new element is null */ public void set(int index, BytesRefWritable bytesRefWritable) { ensureCapacity(index + 1); bytesRefWritables[index] = bytesRefWritable; if (valid <= index) { valid = index + 1; } }
/** * Constructs an empty array with the specified capacity. * * @param capacity * initial capacity * @exception IllegalArgumentException * if the specified initial capacity is negative */ public BytesRefArrayWritable(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Capacity can not be negative."); } bytesRefWritables = new BytesRefWritable[0]; ensureCapacity(capacity); }
/** * {@inheritDoc} */ @Override public void readFields(DataInput in) throws IOException { int count = in.readInt(); ensureCapacity(count); for (int i = 0; i < count; i++) { bytesRefWritables[i].readFields(in); } valid = count; }
/** * enlarge the capacity if necessary, to ensure that it can hold the number of * elements specified by newValidCapacity argument. It will also narrow the * valid capacity when needed. Notice: it only enlarge or narrow the valid * capacity with no care of the already stored invalid BytesRefWritable. * * @param newValidCapacity * the desired capacity */ public void resetValid(int newValidCapacity) { ensureCapacity(newValidCapacity); valid = newValidCapacity; }
/** * enlarge the capacity if necessary, to ensure that it can hold the number of * elements specified by newValidCapacity argument. It will also narrow the * valid capacity when needed. Notice: it only enlarge or narrow the valid * capacity with no care of the already stored invalid BytesRefWritable. * * @param newValidCapacity * the desired capacity */ public void resetValid(int newValidCapacity) { ensureCapacity(newValidCapacity); valid = newValidCapacity; }
/** * enlarge the capacity if necessary, to ensure that it can hold the number of * elements specified by newValidCapacity argument. It will also narrow the * valid capacity when needed. Notice: it only enlarge or narrow the valid * capacity with no care of the already stored invalid BytesRefWritable. * * @param newValidCapacity * the desired capacity */ public void resetValid(int newValidCapacity) { ensureCapacity(newValidCapacity); valid = newValidCapacity; }
/** * enlarge the capacity if necessary, to ensure that it can hold the number of * elements specified by newValidCapacity argument. It will also narrow the * valid capacity when needed. Notice: it only enlarge or narrow the valid * capacity with no care of the already stored invalid BytesRefWritable. * * @param newValidCapacity * the desired capacity */ public void resetValid(int newValidCapacity) { ensureCapacity(newValidCapacity); valid = newValidCapacity; }
/** * enlarge the capacity if necessary, to ensure that it can hold the number of * elements specified by newValidCapacity argument. It will also narrow the * valid capacity when needed. Notice: it only enlarge or narrow the valid * capacity with no care of the already stored invalid BytesRefWritable. * * @param newValidCapacity * the desired capacity */ public void resetValid(int newValidCapacity) { ensureCapacity(newValidCapacity); valid = newValidCapacity; }
/** * Set the BytesRefWritable at the specified position with the specified * BytesRefWritable. * * @param index * index position * @param bytesRefWritable * the new element * @throws IllegalArgumentException * if the specified new element is null */ public void set(int index, BytesRefWritable bytesRefWritable) { ensureCapacity(index + 1); bytesRefWritables[index] = bytesRefWritable; if (valid <= index) { valid = index + 1; } }
/** * Constructs an empty array with the specified capacity. * * @param capacity * initial capacity * @exception IllegalArgumentException * if the specified initial capacity is negative */ public BytesRefArrayWritable(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Capacity can not be negative."); } bytesRefWritables = new BytesRefWritable[0]; ensureCapacity(capacity); }
/** * Constructs an empty array with the specified capacity. * * @param capacity * initial capacity * @exception IllegalArgumentException * if the specified initial capacity is negative */ public BytesRefArrayWritable(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Capacity can not be negative."); } bytesRefWritables = new BytesRefWritable[0]; ensureCapacity(capacity); }
/** * Constructs an empty array with the specified capacity. * * @param capacity * initial capacity * @exception IllegalArgumentException * if the specified initial capacity is negative */ public BytesRefArrayWritable(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Capacity can not be negative."); } bytesRefWritables = new BytesRefWritable[0]; ensureCapacity(capacity); }
/** * Constructs an empty array with the specified capacity. * * @param capacity * initial capacity * @exception IllegalArgumentException * if the specified initial capacity is negative */ public BytesRefArrayWritable(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Capacity can not be negative."); } bytesRefWritables = new BytesRefWritable[0]; ensureCapacity(capacity); }
/** * Constructs an empty array with the specified capacity. * * @param capacity * initial capacity * @exception IllegalArgumentException * if the specified initial capacity is negative */ public BytesRefArrayWritable(int capacity) { if (capacity < 0) { throw new IllegalArgumentException("Capacity can not be negative."); } bytesRefWritables = new BytesRefWritable[0]; ensureCapacity(capacity); }
/** * {@inheritDoc} */ @Override public void readFields(DataInput in) throws IOException { int count = in.readInt(); ensureCapacity(count); for (int i = 0; i < count; i++) { bytesRefWritables[i].readFields(in); } valid = count; }
/** * {@inheritDoc} */ @Override public void readFields(DataInput in) throws IOException { int count = in.readInt(); ensureCapacity(count); for (int i = 0; i < count; i++) { bytesRefWritables[i].readFields(in); } valid = count; }
/** * {@inheritDoc} */ @Override public void readFields(DataInput in) throws IOException { int count = in.readInt(); ensureCapacity(count); for (int i = 0; i < count; i++) { bytesRefWritables[i].readFields(in); } valid = count; }
/** * {@inheritDoc} */ @Override public void readFields(DataInput in) throws IOException { int count = in.readInt(); ensureCapacity(count); for (int i = 0; i < count; i++) { bytesRefWritables[i].readFields(in); } valid = count; }
/** * {@inheritDoc} */ @Override public void readFields(DataInput in) throws IOException { int count = in.readInt(); ensureCapacity(count); for (int i = 0; i < count; i++) { bytesRefWritables[i].readFields(in); } valid = count; }