3 class IntHash implements IteratorAggregate{
4 public function __construct() {
5 if(!php_Boot::$skip_constructor) {
8 public function getIterator() {
9 return $this->iterator();
11 public function toString() {
15 while($»it->hasNext()) {
17 $s .= _hx_string_rec($i, "");
19 $s .= Std::string($this->get($i));
26 public function iterator() {
27 return new _hx_array_iterator(array_values($this->h));
29 public function keys() {
30 return new _hx_array_iterator(array_keys($this->h));
32 public function remove($key) {
33 if(array_key_exists($key, $this->h)) {
34 unset($this->h[$key]);
40 public function exists($key) {
41 return array_key_exists($key, $this->h);
43 public function get($key) {
44 if(array_key_exists($key, $this->h)) {
45 return $this->h[$key];
50 public function set($key, $value) {
51 $this->h[$key] = $value;
54 public function __call($m, $a) {
55 if(isset($this->$m) && is_callable($this->$m))
56 return call_user_func_array($this->$m, $a);
57 else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
58 return call_user_func_array($this->»dynamics[$m], $a);
59 else if('toString' == $m)
60 return $this->__toString();
62 throw new HException('Unable to call «'.$m.'»');
64 function __toString() { return $this->toString(); }