Class GoalLibrary

  • All Implemented Interfaces:
    java.io.Serializable

    public class GoalLibrary
    extends java.lang.Object
    implements java.io.Serializable
    Stores information about all goals in the domain
    Author:
    Joao Dias
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      GoalLibrary​(java.lang.String file)
      Creates a new GoalLibrary
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void AddGoal​(Goal g)  
      Goal GetGoal​(Name goalName)
      Searches for a goal with the given name in the Library.
      java.util.ListIterator<Goal> GetGoals()
      Gets a ListIterator that allows you to iterate over the goals stored in the goal's library
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GoalLibrary

        public GoalLibrary​(java.lang.String file)
                    throws GoalLibParsingException
        Creates a new GoalLibrary
        Parameters:
        file - - the file that contains the information about goals and that will be parsed
        Throws:
        GoalLibParsingException - - thrown when there is a parsing error when reading the GoalLibrary file
    • Method Detail

      • AddGoal

        public void AddGoal​(Goal g)
      • GetGoals

        public java.util.ListIterator<Goal> GetGoals()
        Gets a ListIterator that allows you to iterate over the goals stored in the goal's library
        Returns:
        a ListIterator over goals
      • GetGoal

        public Goal GetGoal​(Name goalName)
        Searches for a goal with the given name in the Library. If such goal is found, it is returned.
        Returns:
        the searched goal if exists in the GoalLibrary, null otherwise