Mercurial > pub > Impl
comparison Lib/IMPL/Object/List.pm @ 4:e59f44f75f20
DOM - в разработке
Testing - по мелочи
Property - изменен механизм выбора имплементора
| author | Sergey |
|---|---|
| date | Wed, 12 Aug 2009 17:36:07 +0400 |
| parents | 2e546a5175dd |
| children | 75980091813b |
comparison
equal
deleted
inserted
replaced
| 3:2e546a5175dd | 4:e59f44f75f20 |
|---|---|
| 4 | 4 |
| 5 use base qw(IMPL::Object::ArrayObject); | 5 use base qw(IMPL::Object::ArrayObject); |
| 6 use IMPL::Exception; | 6 use IMPL::Exception; |
| 7 | 7 |
| 8 sub as_list { | 8 sub as_list { |
| 9 return $_[0]; | 9 return wantarray ? @{$_[0]} : $_[0]; |
| 10 } | 10 } |
| 11 | 11 |
| 12 sub CTOR { | 12 sub CTOR { |
| 13 my ($this,$data) = @_; | 13 my ($this,$data) = @_; |
| 14 | 14 |
| 50 $count ||= 1; | 50 $count ||= 1; |
| 51 | 51 |
| 52 return splice @$this,$index,$count; | 52 return splice @$this,$index,$count; |
| 53 } | 53 } |
| 54 | 54 |
| 55 sub RemoveItem { | |
| 56 my ($this,$item) = @_; | |
| 57 | |
| 58 @$this = grep $_ != $item, @$this; | |
| 59 | |
| 60 return $this; | |
| 61 } | |
| 62 | |
| 63 sub RemoveItemStr { | |
| 64 my ($this,$item) = @_; | |
| 65 | |
| 66 @$this = grep $_ ne $item, @$this; | |
| 67 | |
| 68 return $this; | |
| 69 } | |
| 70 | |
| 71 | |
| 55 1; | 72 1; |
