コード例 #1
0
ファイル: HashSet.php プロジェクト: aeberh/php-movico
 public function add($element)
 {
     if (!$this->isCorrectType($element)) {
         throw new IllegalArgumentException("Tried to add element of type " . TypeUtil::getType($element) . " to list of type " . $this->type);
     }
     $this->elements[$element] = $element;
 }
コード例 #2
0
ファイル: HashMap.php プロジェクト: aeberh/php-movico
 private function isCorrectValueType($value)
 {
     if ($this->valueType === "?") {
         return true;
     }
     return $this->valueType === TypeUtil::getType($value);
 }
コード例 #3
0
ファイル: ArrayList.php プロジェクト: aeberh/php-movico
 protected function isCorrectType($element)
 {
     if ($this->type === "?") {
         return true;
     }
     return $this->type === TypeUtil::getType($element);
 }