HEX
Server: Apache
System: Linux server1.royalgt4.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
User: mostafedeg (1125)
PHP: 5.6.40
Disabled: mail,passthru,parse_ini_file,show_source,eval,assert,pcntl_exec,dl,putenv,proc_open,popen
Upload Files
File: /home/mostafedeg/public_html/erp/models/core/ArrayList.class.php
<?php
/**
 * ArrayList
 *
 * @author: Tomasz Jazwinski
 * @date: 2007-11-28
 */
class ArrayList{
	private $tab;
	private $size;

	public function ArrayList(){
		$this->tab = array();
		$this->size=0;
	}

	/**
	 * Dodanie wartosci do listy
	 */
	public function add($value){
		$this->tab[$this->size] = $value;
		$this->size = ($this->size) +1;
	}

	/**
	 * Pobranie elementu o numerze podanym
	 * jako parametr metody
	 */
	public function get($idx){
		return $this->tab[$idx];
	}

	/**
	 * Pobranie ostatniego elementu
	 */
	public function getLast(){
		if($this->size==0){
			return null;
		}
		return $this->tab[($this->size)-1];
	}

	/**
	 * Rozmiar listy
	 */
	public function size(){
		return $this->size;
	}

	/**
	 * Czy lista jest pusta
	 */
	public function isEmpty(){
		return ($this->size)==0;
	}

	/**
	 * Usuniecie ostatniego
	 */
	public function removeLast(){
		return $this->size = ($this->size) -1;
	}
}
?>