/** * Checks to see if field is null * @param fieldId field to check * @return <code>true</code> if null, else <code>false</code> */ public boolean isNull(long fieldId) { return channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId)<=0; }
/** * Checks to see if field has value * @param fieldId field to check * @return <code>true</code> if field has value, else <code>false</code> */ public boolean hasValue(long fieldId) { return channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId)>0; }
/** * Checks to see if field has value * @param fieldId field to check * @return <code>true</code> if field has value, else <code>false</code> */ public boolean hasValue(long fieldId) { return channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId)>0; }
/** * Checks to see if field is null * @param fieldId field to check * @return <code>true</code> if null, else <code>false</code> */ public boolean isNull(long fieldId) { return channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId)<=0; }
/** * Checks to see if field has value * @param fieldId field to check * @return <code>true</code> if field has value, else <code>false</code> */ public boolean hasValue(long fieldId) { return channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId)>0; }
/** * Checks to see if field is null * @param fieldId field to check * @return <code>true</code> if null, else <code>false</code> */ public boolean isNull(long fieldId) { return channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId)<=0; }
public int dataPositionFromIndexOffset(int indexOffset) { return channelReader.readFromEndLastInt(indexOffset); }
public int dataPositionFromIndexOffset(int indexOffset) { return channelReader.readFromEndLastInt(indexOffset); }
/** * set to a position for general reading unless index position is not provided */ public ChannelReader read(long fieldId) { final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader; } else { return null; } }
/** * set to a position for general reading unless index position is not provided */ public ChannelReader read(long fieldId) { final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader; } else { return null; } }
/** * set to a position for general reading unless index position is not provided */ public ChannelReader read(long fieldId) { final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader; } else { return null; } }
/** * Reads decimal as String and appends to target * @param id long field association showing where to read * @param target to append to * @return appended data */ public <A extends Appendable> A readDecimalAsText(long id, A target) { this.channelReader.position(this.channelReader .readFromEndLastInt(StructRegistry.FIELD_MASK & (int)id)); return channelReader.readDecimalAsText(target); }
/** * Reads decimal as String and appends to target * @param id long field association showing where to read * @param target to append to * @return appended data */ public <A extends Appendable> A readDecimalAsText(long id, A target) { this.channelReader.position(this.channelReader .readFromEndLastInt(StructRegistry.FIELD_MASK & (int)id)); return channelReader.readDecimalAsText(target); }
/** * Used by assertions to ensure that the cursor is set at the right position to read the given field. * This is important because it allows for checks at compile time so the lookup is removed from runtime. * @param association object for the field * @return true if the position of the channelReader is ready to read the field */ public boolean isPositionedToRead(Object association) { int indexOffset = indexOffset(association); final int index = channelReader.readFromEndLastInt(indexOffset); if (index>=0) { return index==channelReader.position(); } return false; }
/** * Used by assertions to ensure that the cursor is set at the right position to read the given field. * This is important because it allows for checks at compile time so the lookup is removed from runtime. * @param association object for the field * @return true if the position of the channelReader is ready to read the field */ public boolean isPositionedToRead(Object association) { int indexOffset = indexOffset(association); final int index = channelReader.readFromEndLastInt(indexOffset); if (index>=0) { return index==channelReader.position(); } return false; }
/** * Reads text at given field * @param fieldId to read from * @return text if data exists, else <code>null</code> */ public String readText(long fieldId) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readUTF(); } else { return null; } }
/** * Reads text at given field * @param fieldId to read from * @return text if data exists, else <code>null</code> */ public String readText(long fieldId) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readUTF(); } else { return null; } }
/** * Reads text at given field * @param fieldId to read from * @return text if data exists, else <code>null</code> */ public String readText(long fieldId) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readUTF(); } else { return null; } }
/** * Reads String as long in given field * @param fieldId field to read from * @return converted String, if field is null return -1 */ public long readTextAsLong(long fieldId) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; assert(Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldType(fieldId) == StructType.Text); final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return DataInputBlobReader.readUTFAsLong(channelReader); } else { return -1; } }
/** * Reads String as double in given field * @param fieldId field to read from * @return converted String, if field is null return -1 */ public double readTextAsDouble(long fieldId) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; assert(Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldType(fieldId) == StructType.Text); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return DataInputBlobReader.readUTFAsDecimal(channelReader); } else { return -1; } }