Treex::PML::List - lists of uniformly typed PML values
This class implements the attribute value type 'list'.
Create a new list (optionally populated with given values).
NOTE: Don't call this constructor directly, use Treex::PML::Factory->createList() instead!
Create a new list consisting of values in a given array reference. Use this constructor instead of new() to pass large lists by reference. If reuse is true, then the same array_ref scalar is used to represent the Treex::PML::List object (i.e. blessed). Otherwise, a copy is created in the constructor.
NOTE: Don't call this constructor directly, use Treex::PML::Factory->createList() instead!
Returns all its values (i.e. the list members).
Return number of values in the list.
Append given values to the list.
An alias for $list-
append()).
Append values from a given list or ARRAY-reference to the current list.
Insert values before the value at a given position in the list. The index of the first position in the list is 0. It is an error if $index is less then 0. If $index equals the index of the last value + 1, then values are appended to the list, but it is an error if $index is greater than that.
Insert all values in $list before the value at a given position in the current list. The index of the first position in the current list is 0. It is an error if $index is less then 0. If $index equals the index of the last value + 1, then values are appended to the list, but it is an error if $index is greater than that.
Delete $count values from the list starting at index $index.
Delete all occurences of value $value. Values are compared as strings.
Delete all occurences of values $value1, $value2,... Values are compared as strings.
Replacing $count values starting at index $index by values provided in the @list (the count of values in @list may differ from $count).
Like replace, but replacement values are taken from a Treex::PML::List object $list.
Return value at index $index. This is in fact the same as $list->[$index] only $index is checked to be non-negative and less then the index of the last value.
Set value at index $index to $value. This is in fact the same as assigning directly to $list->[$index], except that $index is checked to be non-negative and less then the index of the last value. Returns $value.
Search the list for the first occurence of value $value. Returns index of the first occurence or undef if the value is not in the list. (Values are compared as strings.)
Return unique values in the list (ordered by the index of the first occurence). Values are compared as strings.
Return a new Treex::PML::List object consisting of unique values in the current list (ordered by the index of the first occurence). Values are compared as strings.
Remove duplicated values from the list. Values are compared as strings. Returns $list.
Remove all values from the list.
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.