Pangloss::Terms - a collection of Pangloss terms.


Pangloss documentation Contained in the Pangloss distribution.

Index


Code Index:

NAME

Top

Pangloss::Terms - a collection of Pangloss terms.

SYNOPSIS

Top

  use Pangloss::Terms;
  my $terms = new Pangloss::Terms();

  try {
      my $term = $terms->get( $name );
      $terms->add( $term );
      $terms->remove( $term );
      do { ... } foreach ( $terms->list );
  } catch Pangloss::Term::Error with {
      my $e = shift;
      ...
  }

DESCRIPTION

Top

This class contains a collection of Pangloss::Term objects. It inherits its interface from Pangloss::Collection.

The collection is keyed on $term->name().

METHODS

Top

@names = $obj->names

synonym for $obj->keys()

AUTHOR

Top

Steve Purkis <spurkis@quiup.com>

SEE ALSO

Top

Pangloss, Pangloss::Collection, Pangloss::Term, Pangloss::Term::Error


Pangloss documentation Contained in the Pangloss distribution.
package Pangloss::Terms;

use strict;
use warnings::register;

use Error;

use Pangloss::Term;
use Pangloss::Term::Error;
use Pangloss::StoredObject::Error;

use base qw( Pangloss::Collection );

our $VERSION  = ((require Pangloss::Version), $Pangloss::VERSION)[1];
our $REVISION = (split(/ /, ' $Revision: 1.5 $ '))[2];

sub names {
    return shift->keys;
}

sub error_key_nonexistent {
    my $self = shift;
    my $name = shift;
    throw Pangloss::Term::Error(flag => eNonExistent,
				name => $name);
}

sub error_key_exists {
    my $self = shift;
    my $name = shift;
    throw Pangloss::Term::Error(flag => eExists,
				name => $name);
}


1;


__END__

#------------------------------------------------------------------------------