E. Choroba > Treex-PML > Treex::PML::Alt

Download:
Treex-PML-2.17.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 2.16   Source  

NAME ^

Treex::PML::Alt - an alternative of uniformly typed PML values

DESCRIPTION ^

This class implements the attribute value type 'alternative'.

Treex::PML::Alt->new (value1,value2,...)

Create a new alternative (optionally populated with given values).

NOTE: Don't call this constructor directly, use Treex::PML::Factory->createAlt() instead!

Treex::PML::Alt->new_from_ref (array_ref, reuse)

Create a new alternative consisting of values in a given array reference. If reuse is true, then the same array_ref scalar is reused to represent the Treex::PML::Alt object (i.e. blessed). Otherwise, a copy is created in the constructor.

NOTE: Don't call this constructor directly, use Treex::PML::Factory->createAlt() instead!

$alt->values ()

Retrurns a its values (i.e. the alternatives).

$alt->count ()

Retrurn number of values in the alternative.

$alt->add (@values)

Add given values to the alternative. Only values which are not already included in the alternative are added.

$alt->add_list ($list)

Add values of the given list to the alternative. Only values which are not already included in the alternative are added.

$alt->delete_value ($value)

Delete all occurences of value $value. Values are compared as strings.

$alt->delete_values ($value1,$value2,...)

Delete all occurences of values $value1, $value2,... Values are compared as strings.

$list->empty ()

Remove all values from the alternative.

SEE ALSO ^

Treex::PML, Treex::PML::Factory, Treex::PML::Schema, Treex::PML::List

COPYRIGHT AND LICENSE ^

Copyright (C) 2006-2010 by Petr Pajas

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: