summaryrefslogtreecommitdiff
path: root/framework/Collections/TList.php
diff options
context:
space:
mode:
authorxue <>2006-01-05 05:35:55 +0000
committerxue <>2006-01-05 05:35:55 +0000
commit2d5b96ba9878ec36df7bb2af3493bb771c85b032 (patch)
tree0ebe72f5f7c3dc56d6a2c1a89b9d6820e3ecb1ce /framework/Collections/TList.php
parentc4279b69ac0f2fa30fdd661083cb753965ae2850 (diff)
Diffstat (limited to 'framework/Collections/TList.php')
-rw-r--r--framework/Collections/TList.php22
1 files changed, 2 insertions, 20 deletions
diff --git a/framework/Collections/TList.php b/framework/Collections/TList.php
index 232e39c6..b9fbd589 100644
--- a/framework/Collections/TList.php
+++ b/framework/Collections/TList.php
@@ -25,7 +25,6 @@
* unset($list[$index]); // remove the item at $index
* if(isset($list[$index])) // if the list has an item at $index
* foreach($list as $index=>$item) // traverse each item in the list
- * $list->add("item1")->add("item2"); // adding multiple items
* </code>
* Note, count($list) will always return 1. You should use {@link getCount()}
* to determine the number of items in the list.
@@ -85,14 +84,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
}
/**
- * @return integer the number of items in the list
- */
- public function getLength()
- {
- return $this->getCount();
- }
-
- /**
* Returns the item at the specified offset.
* This method is exactly the same as {@link offsetGet}.
* @param integer the index of the item
@@ -111,7 +102,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
* Appends an item at the end of the list.
* @param mixed new item
* @throws TInvalidOperationException If the item is not allowed to be added
- * @return TList this
*/
public function add($item)
{
@@ -122,7 +112,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
}
else
throw new TInvalidOperationException('list_addition_disallowed');
- return $this;
}
/**
@@ -133,7 +122,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
* @param mixed new item
* @throws TInvalidDataValueException If the index specified exceeds the bound
* @throws TInvalidOperationException If the item is not allowed to be added
- * @return TList this
*/
public function insert($index,$item)
{
@@ -152,7 +140,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
}
else
throw new TInvalidOperationException('list_addition_disallowed');
- return $this;
+
}
/**
@@ -162,14 +150,13 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
* @param mixed the item to be removed.
* @throws TInvalidOperationException If the item cannot be removed
* @throws TInvalidDataValueException If the item does not exist
- * @return mixed the removed item
*/
public function remove($item)
{
if(($index=$this->indexOf($item))>=0)
{
if($this->canRemoveItem($item))
- return $this->removeAt($index);
+ $this->removeAt($index);
else
throw new TInvalidOperationException('list_item_unremovable');
}
@@ -208,7 +195,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
/**
* Removes all items in the list.
- * @return TList this
*/
public function clear()
{
@@ -250,7 +236,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
* Note, existing data in the list will be cleared first.
* @param mixed the data to be copied from, must be an array or object implementing Traversable
* @throws TInvalidDataTypeException If data is neither an array nor a Traversable.
- * @return TList this
*/
public function copyFrom($data)
{
@@ -263,7 +248,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
}
else
throw new TInvalidDataTypeException('list_data_not_iterable');
- return $this;
}
/**
@@ -271,7 +255,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
* New data will be appended to the end of the existing data.
* @param mixed the data to be merged with, must be an array or object implementing Traversable
* @throws TInvalidDataTypeException If data is neither an array nor an iterator.
- * @return TList this
*/
public function mergeWith($data)
{
@@ -282,7 +265,6 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess
}
else
throw new TInvalidDataTypeException('list_data_not_iterable');
- return $this;
}
/**