private void internallySetField(int fieldNum, Value value) { // check if we modify an existing field this.offsets[fieldNum] = value != null ? MODIFIED_INDICATOR_OFFSET : NULL_INDICATOR_OFFSET; this.writeFields[fieldNum] = value; markModified(fieldNum); }
/** * Sets the number of fields in the record. If the new number of fields is longer than the current number of * fields, then null fields are appended. If the new number of fields is smaller than the current number of * fields, then the last fields are truncated. * * @param numFields The new number of fields. */ public void setNumFields(final int numFields) { final int oldNumFields = this.numFields; // check whether we increase or decrease the fields if (numFields > oldNumFields) { makeSpace(numFields); for (int i = oldNumFields; i < numFields; i++) { this.offsets[i] = NULL_INDICATOR_OFFSET; } markModified(oldNumFields); } else { // decrease the number of fields // we do not remove the values from the cache, as the objects (if they are there) will most likely // be reused when the record is re-filled markModified(numFields); } this.numFields = numFields; }
System.arraycopy(this.readFields, fieldNum + 1, this.readFields, fieldNum, len); System.arraycopy(this.writeFields, fieldNum + 1, this.writeFields, fieldNum, len); markModified(fieldNum);
private void internallySetField(int fieldNum, Value value) { // check if we modify an existing field this.offsets[fieldNum] = value != null ? MODIFIED_INDICATOR_OFFSET : NULL_INDICATOR_OFFSET; this.writeFields[fieldNum] = value; markModified(fieldNum); }
private void internallySetField(int fieldNum, Value value) { // check if we modify an existing field this.offsets[fieldNum] = value != null ? MODIFIED_INDICATOR_OFFSET : NULL_INDICATOR_OFFSET; this.writeFields[fieldNum] = value; markModified(fieldNum); }
/** * Sets the number of fields in the record. If the new number of fields is longer than the current number of * fields, then null fields are appended. If the new number of fields is smaller than the current number of * fields, then the last fields are truncated. * * @param numFields The new number of fields. */ public void setNumFields(final int numFields) { final int oldNumFields = this.numFields; // check whether we increase or decrease the fields if (numFields > oldNumFields) { makeSpace(numFields); for (int i = oldNumFields; i < numFields; i++) { this.offsets[i] = NULL_INDICATOR_OFFSET; } markModified(oldNumFields); } else { // decrease the number of fields // we do not remove the values from the cache, as the objects (if they are there) will most likely // be reused when the record is re-filled markModified(numFields); } this.numFields = numFields; }
/** * Sets the number of fields in the record. If the new number of fields is longer than the current number of * fields, then null fields are appended. If the new number of fields is smaller than the current number of * fields, then the last fields are truncated. * * @param numFields The new number of fields. */ public void setNumFields(final int numFields) { final int oldNumFields = this.numFields; // check whether we increase or decrease the fields if (numFields > oldNumFields) { makeSpace(numFields); for (int i = oldNumFields; i < numFields; i++) { this.offsets[i] = NULL_INDICATOR_OFFSET; } markModified(oldNumFields); } else { // decrease the number of fields // we do not remove the values from the cache, as the objects (if they are there) will most likely // be reused when the record is re-filled markModified(numFields); } this.numFields = numFields; }
System.arraycopy(this.readFields, fieldNum + 1, this.readFields, fieldNum, len); System.arraycopy(this.writeFields, fieldNum + 1, this.writeFields, fieldNum, len); markModified(fieldNum);
System.arraycopy(this.readFields, fieldNum + 1, this.readFields, fieldNum, len); System.arraycopy(this.writeFields, fieldNum + 1, this.writeFields, fieldNum, len); markModified(fieldNum);