/** * Method set sets the value in the given field or position. * <p> * No coercion is performed if there is an associated coercible type. * * @param fieldName field name or position to set * @param value of type Comparable */ public void setRaw( Comparable fieldName, Object value ) { tuple.set( fields.getPos( asFieldName( fieldName ) ), value ); }
/** * Method getObject returns the value in the given field or position. * <br> * {@code fieldName} may optionally be a {@link Fields} instance. Only the first field name or position will * be considered. * <p> * No coercion is performed if there is an associated coercible type. * * @param fieldName field name or position to return * @return Comparable */ public Object getObject( Comparable fieldName ) { int pos = fields.getPos( asFieldName( fieldName ) ); return tuple.getObject( pos ); }
/** * Method set sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type Comparable */ public void setObject( Comparable fieldName, Object value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method setLong sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type long */ public void setLong( Comparable fieldName, long value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method setBoolean sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type boolean */ public void setBoolean( Comparable fieldName, boolean value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method setString sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type String */ public void setString( Comparable fieldName, String value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method setInteger sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type int */ public void setInteger( Comparable fieldName, int value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method setShort sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type short */ public void setShort( Comparable fieldName, short value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method setFloat sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type float */ public void setFloat( Comparable fieldName, float value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method setDouble sets the value in the given field or position. * * @param fieldName field name or position to set * @param value of type double */ public void setDouble( Comparable fieldName, double value ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); tuple.set( pos, coercions[ pos ].canonical( value ) ); }
/** * Method getObject returns the value in the given field or position as the requested type. * <br> * {@code fieldName} may optionally be a {@link Fields} instance. Only the first field name or position will * be considered. * <p> * Coercion is performed to the given type. * * @param fieldName field name or position to return * @return Comparable */ public Object getObject( Comparable fieldName, Type type ) { int pos = fields.getPos( asFieldName( fieldName ) ); if( pos > coercions.length - 1 ) throw new TupleException( "position value is too large: " + pos + ", positions in field: " + tuple.size() ); return Coercions.coerce( coercions[ pos ], tuple.getObject( pos ), type ); }