| java.lang.Object org.cougaar.lib.util.UTILPrepPhrase
All known Subclasses: org.cougaar.glm.util.GLMPrepPhrase,
UTILPrepPhrase | public class UTILPrepPhrase (Code) | | This class contains utility functions for creating
and accessing PrepositionalPhrases.
|
Method Summary | |
public void | addPrepToTask(Task taskToAddTo, PrepositionalPhrase prepPhrase) Add a prepositionalPhrase to a task. | public void | addPreps(Task taskToAddTo, Vector preps) Adds prepositionalPhrases to a task. | public Object | getIndirectObject(Task t, String prepName) Utility method for extracting the indirect object from a
prepositional phrase. | public List | getPrepListPlusPhrase(Task task, PrepositionalPhrase prepPhrase) Return list of phrases on task plus added one. | public PrepositionalPhrase | getPrepNamed(Task t, String prepName) | public PrepositionalPhrase | getPrepNamed(Enumeration prepphrases, String prepName) Utility method extracting a PrepositionalPhrase from an
Enumeration of PrepositionalPhrases. | public boolean | hasPrepNamed(Task t, String prepName) | public PrepositionalPhrase | makePrepositionalPhrase(PlanningFactory ldmf, String prep, Object indirectObject) Utility methods for creating a PrepositionalPhrases
Uses a cache - only makes unique prepositional phrases
Uses the prepToIndirectMap cache so only distinct instances are created. | public PrepositionalPhrase | removePrepNamed(Task taskToChange, String prepName) Removes a PrepositionalPhrase from a task's
set of PrepositionalPhrases. | public void | removePreps(Task taskToChange, Vector preps) Removes a series of PrepositionalPhrases from a task's
set of PrepositionalPhrases. | public void | replacePrepOnTask(Task taskToAddTo, PrepositionalPhrase prepPhrase) Add a prepositionalPhrase to a task with replacement.
Changes list of phrases on task.
Does NOT require the existence of the prep on the task already, i.e. |
prepToIndirectMap | protected Map prepToIndirectMap(Code) | | maps prepositions to map of indirect objects to prep phrases
|
addPrepToTask | public void addPrepToTask(Task taskToAddTo, PrepositionalPhrase prepPhrase)(Code) | | Add a prepositionalPhrase to a task. Changes list of phrases on task.
Parameters: taskToAddTo - task to add prep phrase to Parameters: prepPhrase - to add to list of prep phrases on task |
addPreps | public void addPreps(Task taskToAddTo, Vector preps)(Code) | | Adds prepositionalPhrases to a task. Changes list of phrases on task.
Risky to use because it does not check whether the added Preps already exist.
Parameters: taskToAddTo - task to add prep phrase to Parameters: preps - Vector of PrepositionalPhrases to add to list of prep phrases on task |
getIndirectObject | public Object getIndirectObject(Task t, String prepName)(Code) | | Utility method for extracting the indirect object from a
prepositional phrase.
Parameters: t - the task Parameters: prepName - the Preposition in String Object |
getPrepListPlusPhrase | public List getPrepListPlusPhrase(Task task, PrepositionalPhrase prepPhrase)(Code) | | Return list of phrases on task plus added one.
Does NOT change original task.
Parameters: task - to get prep phrases from Parameters: prepPhrase - to add to list of prep phrases List with given prep phrase added |
getPrepNamed | public PrepositionalPhrase getPrepNamed(Task t, String prepName)(Code) | | Utility method extracting a PrepositionalPhrase from a
task
Parameters: t - task with preps Parameters: prepName - the String name of the Preposition the preposition named prepName |
getPrepNamed | public PrepositionalPhrase getPrepNamed(Enumeration prepphrases, String prepName)(Code) | | Utility method extracting a PrepositionalPhrase from an
Enumeration of PrepositionalPhrases.
Parameters: prepphrases - an Enum of PrepositionalPhrases Parameters: prepName - the String name of the Preposition the preposition named prepName |
hasPrepNamed | public boolean hasPrepNamed(Task t, String prepName)(Code) | | true if Task t has prepName on list of its prepphrases. |
makePrepositionalPhrase | public PrepositionalPhrase makePrepositionalPhrase(PlanningFactory ldmf, String prep, Object indirectObject)(Code) | | Utility methods for creating a PrepositionalPhrases
Uses a cache - only makes unique prepositional phrases
Uses the prepToIndirectMap cache so only distinct instances are created.
Parameters: ldmf - the PlanningFactory Parameters: prep - the Preposition Parameters: indirectObject - the indirect object - any generic Object the new PrepositionalPhrase |
removePrepNamed | public PrepositionalPhrase removePrepNamed(Task taskToChange, String prepName)(Code) | | Removes a PrepositionalPhrase from a task's
set of PrepositionalPhrases.
Parameters: taskToChange - task to remove the prep from Parameters: prepName - the String name of the Preposition to remove the PrepositionalPhrase named prepName that was removed |
removePreps | public void removePreps(Task taskToChange, Vector preps)(Code) | | Removes a series of PrepositionalPhrases from a task's
set of PrepositionalPhrases.
Parameters: taskToChange - task to remove the prep from Parameters: preps - a Vector of String names of Prepositions to remove |
replacePrepOnTask | public void replacePrepOnTask(Task taskToAddTo, PrepositionalPhrase prepPhrase)(Code) | | Add a prepositionalPhrase to a task with replacement.
Changes list of phrases on task.
Does NOT require the existence of the prep on the task already, i.e. if
can't replace, just adds.
|
|
|