Class ColumnInfo
java.lang.Object
uk.ac.starlink.table.DefaultValueInfo
uk.ac.starlink.table.ColumnInfo
- All Implemented Interfaces:
ValueInfo
Contains information about a table column.
This really does the same thing as its superclass,
DefaultValueInfo, but for historical reasons it contains
some additional methods for access to the
auxiliary metadata items.
In earlier versions of the library, columns were allowed to store
auxiliary metadata and non-column items (like table parameters)
were not, but now they have the same capabilities.- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionColumnInfo(String name) Constructs aColumnInfoobject.ColumnInfo(String name, Class<?> contentClass, String description) Constructs a newColumnInfoobject with a given name, class and description.ColumnInfo(ValueInfo base) Constructs a newColumnInfobased on aValueInfoobject. -
Method Summary
Modifier and TypeMethodDescriptiongetAuxDatum(ValueInfo vinfo) Gets an item of auxiliary metadata from its specification.<T> TgetAuxDatumValue(ValueInfo vinfo, Class<T> clazz) Gets the value of an item of auxiliary metadata using its specification, requiring a particular return type.<T> TgetAuxDatumValueByName(String name, Class<T> clazz) Gets the value of an item of auxiliary metadata by its name, requiring a particular return type.Methods inherited from class DefaultValueInfo
formatClass, formatShape, formatValue, generalise, getAuxData, getContentClass, getDescription, getDomainMappers, getElementSize, getName, getShape, getUCD, getUnitString, getUtype, getXtype, isArray, isNullable, setAuxData, setContentClass, setDescription, setDomainMappers, setElementSize, setName, setNullable, setShape, setUCD, setUnitString, setUtype, setXtype, toString, unformatShape, unformatStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ValueInfo
getAuxDatumByName, setAuxDatum
-
Constructor Details
-
ColumnInfo
Constructs aColumnInfoobject.- Parameters:
name- the name of the column
-
ColumnInfo
Constructs a newColumnInfobased on aValueInfoobject. All attributes are copied from the template to the new object.- Parameters:
base- the templateValueInfo
-
ColumnInfo
Constructs a newColumnInfoobject with a given name, class and description.- Parameters:
name- the name applying to described valuescontentClass- the class of which described values should be instancesdescription- a textual description of the described values
-
-
Method Details
-
getAuxDatum
Gets an item of auxiliary metadata from its specification. Currently this just callsgetAuxDatumByName(vinfo.getName()), but may be revised in future to match on other attributes.- Parameters:
vinfo- the data item to match- Returns:
- a
DescribedValueobject representing the auxiliary metadata item matchingvinfofor this column, ornullif none exists
-
getAuxDatumValue
Gets the value of an item of auxiliary metadata using its specification, requiring a particular return type. This convenience method works likegetAuxDatum(ValueInfo)but returns a non-null value only if the named item exists and if its value is an instance of the given typeclazz.- Parameters:
vinfo- the data item to matchclazz- required return type- Returns:
- value of the auxiliary metadata item matching
vinfofor this column if it exists and is an instance ofclazzor one of its subtypes, otherwisenull
-
getAuxDatumValueByName
Gets the value of an item of auxiliary metadata by its name, requiring a particular return type. This convenience method works likeValueInfo.getAuxDatumByName(String), but returns a non-null value only if the named item exists, and if its value is an instance of the given typeclazz.- Parameters:
name- the name of an auxiliary metadata itemclazz- required return type- Returns:
- value of the auxiliary metadata item matching
vinfofor this column if it exists and is an instance ofclazzor one of its subtypes, otherwisenull
-