Esempio n. 1
0
  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);
  }
Esempio n. 2
0
  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);
  }
Esempio n. 3
0
 public void removeUnaryConstraint(
     String elementId, Class<? extends UnaryConstraint> unaryConstraintClass) {
   furniture.get(elementId).removeUnaryConstraint(unaryConstraintClass);
 }
Esempio n. 4
0
 public void addUnaryConstraint(String elementId, UnaryConstraint unaryConstraint) {
   furniture.get(elementId).addUnaryConstraint(unaryConstraint);
 }
Esempio n. 5
0
 public WantedFixed getWantedFixed(String id) {
   return fixed.get(id);
 }
Esempio n. 6
0
 public WantedFurniture getWantedFurniture(String id) {
   return furniture.get(id);
 }
Esempio n. 7
0
  public Collection<BinaryConstraintEnd> getBinaryConstraints(String elementId) {
    if (!furniture.containsElement(elementId))
      throw new WantedFurnitureNotFoundException(elementId);

    return furniture.get(elementId).getBinaryConstraints();
  }
Esempio n. 8
0
 /**
  * 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();
 }