|
|||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||||
java.lang.Objectweka.classifiers.EnsembleLibrary
public class EnsembleLibrary
This class represents a library of classifiers. This class follows the factory design pattern of creating LibraryModels when asked. It also has the methods necessary for saving and loading models from lists.
| Field Summary | |
|---|---|
static java.lang.String |
FLAT_FILE_EXTENSION
The flat file extension for model list files |
java.util.TreeSet |
m_Models
the set of classifiers that constitute the library |
static java.lang.String |
XML_FILE_EXTENSION
The default file extension for model list files |
| Constructor Summary | |
|---|---|
EnsembleLibrary()
Constructor is responsible for initializing the data structure hoilding all of the models |
|
| Method Summary | |
|---|---|
void |
addModel(EnsembleLibraryModel model)
adds a LibraryModel to the Library |
void |
addModel(java.lang.String modelString)
adds a LibraryModel to the Library |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds an object to the list of those that wish to be informed when the library changes. |
void |
clearModels()
removes all models from the current library |
EnsembleLibraryModel |
createModel(Classifier classifier)
creates a LibraryModel from a string representing the command line invocation |
EnsembleLibraryModel |
createModel(java.lang.String modelString)
This method takes a String argument defining a classifier and uses it to create a base Classifier. |
java.util.TreeSet |
getModels()
getter for the set of models in this library |
java.lang.String |
getRevision()
Returns the revision string. |
static void |
loadLibrary(java.io.File selectedFile,
EnsembleLibrary library)
This method takes a model list file and a library object as arguments and Instantiates all of the models in the library list file. |
static void |
loadLibrary(java.io.File selectedFile,
javax.swing.JComponent dialogParent,
EnsembleLibrary library)
Loads and returns a library from the specified file |
static void |
loadLibrary(java.io.InputStream stream,
EnsembleLibrary library)
This method takes an XML input stream and a library object as arguments and Instantiates all of the models in the stream. |
void |
removeModel(EnsembleLibraryModel model)
removes a LibraryModel from the Library |
static void |
saveLibrary(java.io.File selectedFile,
EnsembleLibrary library,
javax.swing.JComponent dialogParent)
Saves the given library in the specified file. |
void |
setModels(java.util.TreeSet models)
setter for the set of models in this library |
int |
size()
Returns the number of models in the ensemble library |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String XML_FILE_EXTENSION
public static final java.lang.String FLAT_FILE_EXTENSION
public java.util.TreeSet m_Models
| Constructor Detail |
|---|
public EnsembleLibrary()
| Method Detail |
|---|
public int size()
public void addModel(EnsembleLibraryModel model)
model - the model to addpublic void addModel(java.lang.String modelString)
modelString - the model to addpublic void removeModel(EnsembleLibraryModel model)
model - the model to removepublic EnsembleLibraryModel createModel(Classifier classifier)
classifier - the classifier to create a model from
public EnsembleLibraryModel createModel(java.lang.String modelString)
modelString - the classifier string
public java.util.TreeSet getModels()
public void setModels(java.util.TreeSet models)
models - the models to usepublic void clearModels()
public static void loadLibrary(java.io.File selectedFile,
javax.swing.JComponent dialogParent,
EnsembleLibrary library)
selectedFile - the file to load fromdialogParent - the parent componentlibrary - will contain the data after loading
public static void loadLibrary(java.io.File selectedFile,
EnsembleLibrary library)
throws java.lang.Exception
selectedFile - the file to loadlibrary - the library
java.lang.Exception - if something goes wrong
public static void loadLibrary(java.io.InputStream stream,
EnsembleLibrary library)
throws java.lang.Exception
stream - the XML stream to loadlibrary - the library
java.lang.Exception - if something goes wrong
public static void saveLibrary(java.io.File selectedFile,
EnsembleLibrary library,
javax.swing.JComponent dialogParent)
selectedFile - the file to save tolibrary - the library to savedialogParent - the component parentpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - a new listener to add to the listpublic java.lang.String getRevision()
getRevision in interface RevisionHandler
|
|||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||||