The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Astro::STSDAS::Table::Columns - Container for table columns

SYNOPSIS

  use Astro::STSDAS::Table::Columns;

DESCRIPTION

Astro::STSDAS::Table::Columns is a container for a set of Astro::STSDAS::Table::Column objects.

Column names are stored as mixed case, but case is ignored when searching by name. All methods which return column names return them as stored (i.e. in mixed case).

Methods

new
  $cols = Astro::STSDAS::Table::Columns->new;

The constructor. It takes no arguments.

ncols
  $ncols = $cols->ncols

The number of columns in the container

add
  $newcol = $cols->add( ... )

Add a column to the container. It takes the same arguments as the Astro::STSDAS::Table::Column constructor. It returns a reference to the new column object.

del
  $cols->del( $col )

Delete the passed Astro::STSDAS::Table::Column object from the container. It returns 1 if successful, 0 if not.

delbyname

Delete the named column from the container. It returns 1 if successful, 0 if not.

byidx
  $col = $cols->byidx( $idx );

return the column with the specified zero-based index in the list of columns.

byname
  $col = $cols->byname( $name );

return the column with the specified name.

cols
  @cols = $cols->cols;

returns a list of the columns (as Astro::STSDAS::Table::Column objects) sorted on column index.

names
  @names = $cols->names;

returns a list of column names, sorted on column index.

rename
  $cols->rename( $oldname, $newname );

Rename the named column. It is important to use this method rather than a column's name method, to ensure the integrity of the container.

copy
  $new_cols = $cols->copy;

This returns a new Astro::STSDAS::Table::Columns object which is a copy of the current object. The contained Astro::STSDAS::Table::Column objects are copies of the originals.

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

Astro::STSDAS::Table, Astro::STSDAS::Table::Column, perl(1).