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.
-
MIFFactory()
-
Constructs a new empty MIF factory with only the default
contract concept
"http://builtin/#contract".
-
addConcept(MIFConcept)
- Adds the specified concept to this factory.
-
addDeclaration(MIFDeclaration)
-
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a property change listener that will be notified each time
the MIFFactory state changes.
-
firePropertyChange()
- Notifies all property change listeners that the state has changed.
-
getConcept(String)
- Returns the specified concept.
-
getConcept(URL)
- Returns the specified concept.
-
getConcepts()
- Returns an enumeration of all concepts.
-
getContractRef()
-
Returns the name of the root contract
-
getDeclaration(String)
-
-
loadConcepts(String)
- Reads the concepts from the specified file.
-
main(String[])
-
-
mfAddDeclaration(MIFDeclaration)
-
-
mfGetDeclaration(String)
-
-
removeConcept(String)
- Removes the specified concept from this factory.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a property change listener.
-
setState(Object)
- Sets the state of the MIFFactory object.
-
setStoreFile(String)
- Indicates that all further changes to the MIFFactory database of
concepts should be stored in the specified file.
-
storeConcepts(String)
- Stores all registered concepts to the specified file.
MIFFactory
public MIFFactory()
- Constructs a new empty MIF factory with only the default
contract concept
"http://builtin/#contract".
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.
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.
removePropertyChangeListener
public static void removePropertyChangeListener(PropertyChangeListener l)
- Removes a property change listener.
- Parameters:
- l - the property change listener to remove.
firePropertyChange
public static void firePropertyChange()
- Notifies all property change listeners that the state has changed.
getContractRef
public static final String getContractRef()
- Returns the name of the root contract
- Returns:
- the name of the root contract.
getConcepts
public static Enumeration getConcepts()
- Returns an enumeration of all concepts.
- Returns:
- an enumeration of all concepts.
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.
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.
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.
storeConcepts
public static void storeConcepts(String fileName)
- Stores all registered concepts to the specified file.
- Parameters:
- fileName - the file to store the MIFFactory state.
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.
addConcept
public static void addConcept(MIFConcept concept)
- Adds the specified concept to this factory.
- Parameters:
- concept - the concept to add.
removeConcept
public static void removeConcept(String ref)
- Removes the specified concept from this factory.
- Parameters:
- ref - the name of the concept to remove.
addDeclaration
public static void addDeclaration(MIFDeclaration decl)
mfAddDeclaration
public synchronized void mfAddDeclaration(MIFDeclaration decl)
getDeclaration
public static MIFDeclaration getDeclaration(String ref)
mfGetDeclaration
public synchronized MIFDeclaration mfGetDeclaration(String ref)
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index