All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sics.agentbase.mif.MIFFactory

java.lang.Object
   |
   +----sics.agentbase.mif.MIFFactory

public class MIFFactory
extends Object
The MIFFactory class implements a factory for MIFConcepts where MIF concepts can be registered and requested. If a concept is requested that not is registered, it is fetched using the concept name as a URL to the definition file.


Constructor Index

 o MIFFactory()
Constructs a new empty MIF factory with only the default contract concept "http://builtin/#contract".

Method Index

 o addConcept(MIFConcept)
Adds the specified concept to this factory.
 o addDeclaration(MIFDeclaration)
 o addPropertyChangeListener(PropertyChangeListener)
Adds a property change listener that will be notified each time the MIFFactory state changes.
 o firePropertyChange()
Notifies all property change listeners that the state has changed.
 o getConcept(String)
Returns the specified concept.
 o getConcept(URL)
Returns the specified concept.
 o getConcepts()
Returns an enumeration of all concepts.
 o getContractRef()
Returns the name of the root contract
 o getDeclaration(String)
 o loadConcepts(String)
Reads the concepts from the specified file.
 o main(String[])
 o mfAddDeclaration(MIFDeclaration)
 o mfGetDeclaration(String)
 o removeConcept(String)
Removes the specified concept from this factory.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a property change listener.
 o setState(Object)
Sets the state of the MIFFactory object.
 o setStoreFile(String)
Indicates that all further changes to the MIFFactory database of concepts should be stored in the specified file.
 o storeConcepts(String)
Stores all registered concepts to the specified file.

Constructors

 o MIFFactory
 public MIFFactory()
Constructs a new empty MIF factory with only the default contract concept "http://builtin/#contract".

Methods

 o setState
 public static void setState(Object state)
Sets the state of the MIFFactory object. Overrides all previously set values.

Parameters:
state - the state to set.
 o addPropertyChangeListener
 public static void addPropertyChangeListener(PropertyChangeListener l)
Adds a property change listener that will be notified each time the MIFFactory state changes.

Parameters:
l - the property change listener to add.
 o removePropertyChangeListener
 public static void removePropertyChangeListener(PropertyChangeListener l)
Removes a property change listener.

Parameters:
l - the property change listener to remove.
 o firePropertyChange
 public static void firePropertyChange()
Notifies all property change listeners that the state has changed.

 o getContractRef
 public static final String getContractRef()
Returns the name of the root contract

Returns:
the name of the root contract.
 o getConcepts
 public static Enumeration getConcepts()
Returns an enumeration of all concepts.

Returns:
an enumeration of all concepts.
 o getConcept
 public static MIFConcept getConcept(String ref)
Returns the specified concept.

Parameters:
ref - the name of the concept to return as a string.
Returns:
the specified concept or null if the concept could not be found or fetched.
 o getConcept
 public static MIFConcept getConcept(URL url)
Returns the specified concept.

Parameters:
ref - the name of the concept to return as a URL.
Returns:
the specified concept or null if the concept could not be found or fetched.
 o setStoreFile
 public static void setStoreFile(String filename)
Indicates that all further changes to the MIFFactory database of concepts should be stored in the specified file.

Parameters:
filename - the name of a file where the concept will be stored whenever the concept database changes.
 o storeConcepts
 public static void storeConcepts(String fileName)
Stores all registered concepts to the specified file.

Parameters:
fileName - the file to store the MIFFactory state.
 o loadConcepts
 public static void loadConcepts(String fileName)
Reads the concepts from the specified file. All previously registered concepts is overridden.

Parameters:
fileName - the file to read the concepts from.
 o addConcept
 public static void addConcept(MIFConcept concept)
Adds the specified concept to this factory.

Parameters:
concept - the concept to add.
 o removeConcept
 public static void removeConcept(String ref)
Removes the specified concept from this factory.

Parameters:
ref - the name of the concept to remove.
 o addDeclaration
 public static void addDeclaration(MIFDeclaration decl)
 o mfAddDeclaration
 public synchronized void mfAddDeclaration(MIFDeclaration decl)
 o getDeclaration
 public static MIFDeclaration getDeclaration(String ref)
 o mfGetDeclaration
 public synchronized MIFDeclaration mfGetDeclaration(String ref)
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index