Package element

Class Place


  • public class Place
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  Place.UndefinedToken
      exception to handle negative value for token
    • Constructor Summary

      Constructors 
      Constructor Description
      Place​(int token)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void changeToken​(int i)  
      boolean equals​(java.lang.Object o)  
      int getToken()  
      boolean isEmpty()
      check if the place is not empty
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getToken

        public int getToken()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the place
      • isEmpty

        public boolean isEmpty()
        check if the place is not empty
      • changeToken

        public void changeToken​(int i)
        Parameters:
        int - value that the place has to add to its token value
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
        Parameters:
        Object - to compare to the place the goal of this method is to check if two places are the same object (same identityHashCode)