Class EquPlace


  • public class EquPlace
    extends PlaceAbstract
    The EquPlace is a place which can contains multiple tokens
    • Constructor Detail

      • EquPlace

        public EquPlace​(EquNet net,
                        int number,
                        String name,
                        int distance,
                        boolean startPlace)
        instantiate an EquPlace
    • Method Detail

      • getPre

        public EquTransition getPre()
        get the previous transition of the place
      • getPost

        public EquTransition getPost()
        get the next transition of the place
      • setPre

        public void setPre​(EquTransition t)
        set the next transition of the place
        Parameters:
        t - the EquTransition
      • setPost

        public void setPost​(EquTransition t)
        set the postset of current place
        Parameters:
        t - the EquTransition
      • addToken

        public void addToken​(Token token)
        add a token to this place
      • setEmpty

        public void setEmpty()
        empties the current place
      • getDistance

        public int getDistance()
        get the length of this place
      • isStartPlace

        public boolean isStartPlace()
        check if it place is the origin of the loop
      • getReadyToken

        public Token getReadyToken()
        get the token at the end of this place or return null is there are none
      • getTokens

        public ArrayList<Token> getTokens()
        returns the current contents of the place
        Returns:
      • isMarked

        public boolean isMarked()
        True if the place contains some token
        Returns:
      • toString

        public String toString()
        display information of the place in the console
        Overrides:
        toString in class Object