Mercurial > pub > Impl
comparison Lib/IMPL/Object/List.pm @ 3:2e546a5175dd
in developing
| author | Sergey |
|---|---|
| date | Tue, 11 Aug 2009 17:45:52 +0400 |
| parents | 78cd38551534 |
| children | e59f44f75f20 |
comparison
equal
deleted
inserted
replaced
| 2:78cd38551534 | 3:2e546a5175dd |
|---|---|
| 1 package IMPL::Object::List; | 1 package IMPL::Object::List; |
| 2 use strict; | 2 use strict; |
| 3 use warnings; | 3 use warnings; |
| 4 | 4 |
| 5 use base qw(IMPL::Object::ArrayObject); | 5 use base qw(IMPL::Object::ArrayObject); |
| 6 use IMPL::Exception; | |
| 6 | 7 |
| 7 sub as_list { | 8 sub as_list { |
| 8 return $_[0]; | 9 return $_[0]; |
| 10 } | |
| 11 | |
| 12 sub CTOR { | |
| 13 my ($this,$data) = @_; | |
| 14 | |
| 15 if ($data) { | |
| 16 die new IMPL::InvalidArgumentException("The parameter should be a reference to an array") unless UNIVERSAL::isa($data,"ARRAY"); | |
| 17 @$this = @$data; | |
| 18 } | |
| 9 } | 19 } |
| 10 | 20 |
| 11 sub Append { | 21 sub Append { |
| 12 push @{$_[0]}, @_{1 .. @$_-1}; | 22 push @{$_[0]}, @_{1 .. @$_-1}; |
| 13 } | 23 } |
