NAME
Astro::STSDAS::Table::Column - An object representing column information
SYNOPSIS
use Astro::STSDAS::Table::Column;
DESCRIPTION
An Astro::STSDAS::Table::Column object represents a single column in an STSDAS table. It does not store data for the column; it simply manages attributes of the column. The following attributes exist for all columns:
- name
-
the column name
- units
-
the column units
- format
-
the column format
- idx
-
the index of the column in the table (unary based)
Binary table columns have the following additional attributes:
- offset
-
the byte offset from the start of the row (for row ordered tables)
- type
-
the data representation type. See Astro::STSDAS::Table::Constants.
- nelem
-
the number of items in a column element. If the data type is a string, this is the maximum number of characters. if not a string, and if greater than one, it indicates a vector.
- fmt
-
A Perl pack() compatible format used to parse this column. This takes into account the number of elements in a vector.
- size
-
The number of bytes in the data type
- ifmt
-
A Perl pack() compatible format used to parse this column. This does not take into account the number of elements in a vector.
Accessing attributes
Each attribute has an eponymously named method with which the attribute value may be retrieved. The method may also be used to set attributes' values for modifiable attributes. For example:
$oldname = $col->name;
$col->name( $newname );
Modifiable attributes are: name
, units
, format
. If a set of columns is being managed in an Astro::STSDAS::Table::Columns container, it is very important to use that container's rename method to change a column's name, else the container will get very confused.
Other Methods
- new
-
$column = Astro::STSDAS::Table::Column->new( $name, $units, $format, $idx, $offset, $type, $nelem );
This is the constructor. It returns an Astro::STSDAS::Table::Column object. Attributes which are inappropriate for the column may be passed as undef. See above for the definition of the attributes. This is generally only called by a Astro::STSDAS::Table::Columns object.
- is_string
-
This returns true if the column is a string column.
- is_indef
-
$bad_value = $col->is_indef( $value );
This determines if the passed value matches the undefined value appropriate to the column.
- is_vector
-
Returns true if the column's elements are vectors.
- nelem
-
This returns the number of items in a column element. This will normally be
1
, except for vector columns. - copy
-
This returns a copy of the column (as an Astro::STSDAS::Table::Column object).
EXPORT
None by default.
LICENSE
This software is released under the GNU General Public License. You may find a copy at
http://www.fsf.org/copyleft/gpl.html
AUTHOR
Diab Jerius (djerius@cpan.org)
SEE ALSO
perl(1).