Lines Matching defs:pos
162 * @param string $pos 0-based index where the element will be inserted.
167 public function insertElement($pos, $elem)
169 array_splice($this->_content, $pos, 0, array($elem));
177 * @param int $pos 0-based index the element will be placed at.
182 public function replaceElement($pos, $elem)
186 array_splice($this->_content, $pos, 1, $rep);
201 foreach ($this->_content as $pos => $elem) {
203 return $pos;
220 foreach ($this->_content as $pos => $elem) {
222 return $pos;
240 foreach ($this->_content as $pos => $elem) {
242 return $pos;
254 * @param int $pos 0-based index
259 public function &getElementAt($pos)
261 if ($pos < 0) $pos = count($this->_content) + $pos;
262 if ($pos < 0) $pos = 0;
263 if ($pos >= count($this->_content)) $pos = count($this->_content) - 1;
264 return $this->_content[$pos];