public InterioresVariable getElement(String id) { if (furniture.containsElement(id)) return furniture.get(id); if (fixed.containsElement(id)) return fixed.get(id); throw new WantedElementNotFoundException("element", id); }
public void removeWantedFurniture(String elementId) { String typeName = furniture.getElementTypeName(elementId); // if type is mandatory and only one is remaining... if (room.isMandatory(typeName) && furniture.getTypeCount(typeName) == 1) throw new MandatoryFurnitureException(typeName, room.getTypeName()); furniture.get(elementId).removeBinaryConstraints(); furniture.remove(elementId); }
public void removeUnaryConstraint( String elementId, Class<? extends UnaryConstraint> unaryConstraintClass) { furniture.get(elementId).removeUnaryConstraint(unaryConstraintClass); }
public void addUnaryConstraint(String elementId, UnaryConstraint unaryConstraint) { furniture.get(elementId).addUnaryConstraint(unaryConstraint); }
public WantedFixed getWantedFixed(String id) { return fixed.get(id); }
public WantedFurniture getWantedFurniture(String id) { return furniture.get(id); }
public Collection<BinaryConstraintEnd> getBinaryConstraints(String elementId) { if (!furniture.containsElement(elementId)) throw new WantedFurnitureNotFoundException(elementId); return furniture.get(elementId).getBinaryConstraints(); }
/** * Returns all the constraints (both unary and binary) of a given WantedFurniture. * * @param furnitureID the identifier of the WantedFurniture * @return the set of constraints */ public Collection<UnaryConstraint> getUnaryConstraints(String elementId) { return furniture.get(elementId).getUnaryConstraints(); }