/** * *************************************** getAllSimbolInScope * * @param Scope ambit to search * @return a list with structure in the scope ambit *************************************** */ public LinkedList<Structure> getAllStructureInScope(Scope ambit) { LinkedList<Structure> list = new LinkedList<Structure>(); for (Structure a : this.table) { if (a.getScope().getName() == ambit.getName()) { list.add(a); } } return list; }
/** * *************************************** addStructure * * @param string id * @param scope * @param member's list * @return saying if can add *************************************** */ public boolean addStructure(Structure struct) { // TODO revisar si ya existe Structure st = this.getStructure(struct.getId(), struct.getScope()); // significa que no existía.. if (st == null) { return table.add(struct); } // si no es null significa que ya existe esa estructura return false; }