Class LockElement

java.lang.Object
eu.su.mas.dedale.env.mapElements.LockElement

public class LockElement extends Object
  • Constructor Details

    • LockElement

      public LockElement()
      Create a lock, closed by default
    • LockElement

      public LockElement(Set<dataStructures.tuple.Couple<LockElement.LockType,Integer>> openningCriteria)
      Create a lock with its opening criteria list. The lock starts as closed.
      Parameters:
      openningCriteria - conditions to set for a given lock
  • Method Details

    • addCriteria

      public void addCriteria(dataStructures.tuple.Couple<LockElement.LockType,Integer> c)
      Adding an opening criteria to an existing lock
      Parameters:
      c - criteria to add
    • isOpen

      public boolean isOpen()
      Returns:
      true is the object is already open
    • tryToOpen

      public boolean tryToOpen(Map<LockElement.LockType,Integer> expertise)
      Parameters:
      expertise - the level of knowledge used to try to open the lock
      Returns:
      true is the lock is now open
    • close

      public void close()
      Close the lock
    • getOpenningCriteria

      public Set<dataStructures.tuple.Couple<LockElement.LockType,Integer>> getOpenningCriteria()
      Returns:
      the list of criteria required to open the object
    • toString

      public String toString()
      Overrides:
      toString in class Object