| 1 | |||
| 2 | =head2 Treex::PML::Seq::Element | ||
| 3 | |||
| 4 | This class implements an element of a 'sequence', i.e. a name-value | ||
| 5 | pair. | ||
| 6 | |||
| 7 | =over 4 | ||
| 8 | |||
| 9 | =cut | ||
| 10 | |||
| 11 | package Treex::PML::Seq::Element; | ||
| 12 | 9 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 9 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 9 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 9 | ▶ | use vars qw($VERSION); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 9 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 9 | $VERSION='2.29'; # version template | |
| 19 | } | ||
| 20 | 9 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | |||
| 22 | =item Treex::PML::Seq::Element->new (name, value) | ||
| 23 | |||
| 24 | Create a new sequence element. | ||
| 25 | |||
| 26 | =cut | ||
| 27 | |||
| 28 | 19 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 29 | 19 | my ($class,$name, $value) = @_; | |
| 30 | 19 | return bless [$name,$value],$class; | |
| 31 | } | ||
| 32 | |||
| 33 | =item $el->name () | ||
| 34 | |||
| 35 | Return the name of the element. | ||
| 36 | |||
| 37 | =cut | ||
| 38 | |||
| 39 | 0 | ▶ | sub name { |
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 40 | 0 | $_[0]->[0]; | |
| 41 | } | ||
| 42 | |||
| 43 | |||
| 44 | =item $el->value () | ||
| 45 | |||
| 46 | Return the value of the element. | ||
| 47 | |||
| 48 | =cut | ||
| 49 | |||
| 50 | 34 | ▶ | sub value { |
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
documented
| |||
| 51 | 34 | $_[0]->[1]; | |
| 52 | } | ||
| 53 | |||
| 54 | =item $el->set_name (name) | ||
| 55 | |||
| 56 | Set name of the element | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | 0 | ▶ | sub set_name { |
|
Subroutine
set_name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 61 | 0 | $_[0]->[0] = $_[1]; | |
| 62 | } | ||
| 63 | |||
| 64 | =item $el->set_value (value) | ||
| 65 | |||
| 66 | Set value of the element | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | 0 | ▶ | sub set_value { |
|
Subroutine
set_value: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 71 | 0 | $_[0]->[1] = $_[1]; | |
| 72 | } | ||
| 73 | |||
| 74 | =back | ||
| 75 | |||
| 76 | =cut | ||
| 77 | |||
| 78 | 9 | 1; | |
| 79 | __END__ | ||