/** * 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; } }
public <A extends Appendable> A readRationalAsText(long fieldId, A target) { 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.Rational); final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readRationalAsText(target); } else { try { target.append("null"); } catch (IOException e) { throw new RuntimeException(e); } return target; } }
public <A extends Appendable> A readRationalAsText(long fieldId, A target) { 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.Rational); final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readRationalAsText(target); } else { try { target.append("null"); } catch (IOException e) { throw new RuntimeException(e); } return target; } }
/** * 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; } }
/** * Reads boolean from specified field in pipe * @param fieldId field to read from * @return <code>false</code> when absent, else <code>true</code> */ public boolean readBoolean(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.Boolean); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readBoolean(); } else { return false; } }
/** * 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 boolean from specified field in pipe * @param fieldId field to read from * @return <code>false</code> when absent, else <code>true</code> */ public boolean readBoolean(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.Boolean); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readBoolean(); } else { return false; } }
/** * 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; } }
/** * 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 boolean from specified field in pipe * @param fieldId field to read from * @return <code>false</code> when absent, else <code>true</code> */ public boolean readBoolean(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.Boolean); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readBoolean(); } else { return false; } }
/** * Reads decimal as double from specified field in pipe * @param fieldId field to read from * @return <code>NaN</code> if field is absent, else double */ public double readDecimalAsDouble(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.Decimal); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readDecimalAsDouble(); } else { return nullReadOfDouble(); } }
/** * Reads decimal mantissa from specified field in pipe * @param fieldId field to read from * @return -1 if absent, else mantissa */ public long readDecimalMantissa(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.Decimal); final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); final long m = channelReader.readPackedLong(); assert(channelReader.storeMostRecentPacked(m)); return m; } else { return -1; } }
/** * Reads rational as double from specified field in pipe * @param fieldId field to read from * @return channelReader if index >= 0, else <code>NaN</code> */ public double readRationalAsDouble(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.Rational); final int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readRationalAsDouble(); } else { return nullReadOfDouble(); } }
/** * Reads decimal as double from specified field in pipe * @param fieldId field to read from * @return <code>NaN</code> if field is absent, else double */ public double readDecimalAsDouble(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.Decimal); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readDecimalAsDouble(); } else { return nullReadOfDouble(); } }
/** * Reads text from specified field in pipe * @param fieldId field to read from * @param target to append text * @return target with appended data */ public <A extends Appendable> A readText(long fieldId, A target) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; assert isTextOrBlob(fieldId) : "Field type is expected to be text or blob but was "+Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldType(fieldId); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); channelReader.readUTF(target); } return target; }
/** * Reads decimal as double from specified field in pipe * @param fieldId field to read from * @return <code>NaN</code> if field is absent, else double */ public double readDecimalAsDouble(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.Decimal); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); return channelReader.readDecimalAsDouble(); } else { return nullReadOfDouble(); } }
/** * Reads text from specified field in pipe * @param fieldId field to read from * @param target to append text * @return target with appended data */ public <A extends Appendable> A readText(long fieldId, A target) { assert(0==Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).dims(fieldId)) : "This method only used for non dim fields."; assert isTextOrBlob(fieldId) : "Field type is expected to be text or blob but was "+Pipe.structRegistry(DataInputBlobReader.getBackingPipe(channelReader)).fieldType(fieldId); int index = channelReader.readFromEndLastInt(StructRegistry.FIELD_MASK&(int)fieldId); if (index>=0) { channelReader.position(index); channelReader.readUTF(target); } return target; }