Class WorldObject

  • Direct Known Subclasses:
    Creature, Food, Obstacle

    public class WorldObject
    extends java.lang.Object
    Editable Java class for concept WorldObject of hunterprey ontology.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Location location
      The location of the object.
    • Constructor Summary

      Constructors 
      Constructor Description
      WorldObject()
      Create a new WorldObject.
      WorldObject​(Location location)
      Create a new WorldObject.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Test if two worldobjects are equal.
      Location getLocation()
      Get the location of this WorldObject.
      int hashCode()
      Get the hash code of the world object.
      void setLocation​(Location location)
      Set the location of this WorldObject.
      java.lang.String toString()
      Get a string representation of this WorldObject.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • location

        protected Location location
        The location of the object.
    • Constructor Detail

      • WorldObject

        public WorldObject()
        Create a new WorldObject.
      • WorldObject

        public WorldObject​(Location location)
        Create a new WorldObject.
    • Method Detail

      • getLocation

        public Location getLocation()
        Get the location of this WorldObject. The location of the object.
        Returns:
        location
      • setLocation

        public void setLocation​(Location location)
        Set the location of this WorldObject. The location of the object.
        Parameters:
        location - the value to be set
      • toString

        public java.lang.String toString()
        Get a string representation of this WorldObject.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.
      • equals

        public boolean equals​(java.lang.Object o)
        Test if two worldobjects are equal.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Get the hash code of the world object.
        Overrides:
        hashCode in class java.lang.Object