All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.ac.starlink.gbin.Representation Maven / Gradle / Ivy

There is a newer version: 4.3
Show newest version
package uk.ac.starlink.gbin;

/**
 * Defines how an object type in a GBIN file will be represented
 * when the GBIN file is turned into a table.
 *
 * @author   Mark Taylor
 * @since    3 Sep 2015
 */
public interface Representation {

    /**
     * Returns the object type with which this representation presents values.
     * All calls to representValue must return an instance of
     * this class (or null).
     *
     * @return  representation class for values
     */
    Class getContentClass();

    /**
     * Transforms a raw data value to the value as presented by this
     * representation.
     *
     * @param  value   raw value obtained from GBIN file
     * @return   presented value of object, must be compatible with
     *           declared content class
     */
    T representValue( Object value );

    /**
     * Indicates whether values presented by this object are suitable
     * for use as columns in a table.  If not, the assumption is that
     * it's a structured object, and its component parts may be
     * recursed through to acquire multiple records corresponding
     * to one value presented here.
     *
     * @return   true  iff represented values are suitable column values
     */
    boolean isColumn();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy