public class TdbClassificationScheme extends TdbMessageProvider implements com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider, java.lang.Iterable<TdbCategory>
Constructor and Description |
---|
TdbClassificationScheme(TdbSession session)
Constructor, creates a blank container
|
TdbClassificationScheme(TdbSession session,
TdbControlObject ob)
Constructor, creates an object for the container referenced by the
provided TdbControlObject
|
Modifier and Type | Method and Description |
---|---|
TdbCategory |
add(java.lang.String name,
java.lang.String comment)
Add a new category to the scheme.
|
void |
classify(java.lang.String data,
java.util.List<TdbCategory> categories)
Test classification with the container.
|
void |
create()
Create a new container
|
void |
create(java.lang.String name)
Create a new container.
|
void |
create(java.lang.String name,
int subsystem)
Create a new container, using the specified subsystem.
|
void |
create(java.lang.String name,
int subsystem,
int max_items)
Create a new container, using the specified subsystem.
|
void |
delete()
Remove the current container from the server in its entirety.
|
void |
delete(java.lang.String name)
Remove a container from the server in its entirety.
|
void |
finalizeContainer()
Finalize container training, whatever that means for the underlying subsystem.
|
void |
get()
Retrieve the properties of the current container, including the list of all categories
defined within it.
|
void |
get(java.lang.String name)
Retrieve the properties of a container, including the list of all categories
defined within it.
|
java.lang.String |
getAlgorithmName()
Retrieve the name of the algorithm, or classification subsystem, used to create
the scheme
|
TdbCategory |
getCategory(int id)
Retrieve the category with the provided unique ID, if found.
|
TdbCategory |
getCategory(java.lang.String name)
Retrieve the category with the provided name, if found.
|
TdbControlObject |
getControlObject()
Retrieve the Control object reference with which this instance was constructed
|
java.lang.String |
getDescription()
Retrieve any description associated with the scheme
|
java.lang.String |
getLastIndex()
Retrieve the last date / time that the scheme was indexed
|
java.lang.String |
getLastUpdate()
Retrieve the last date / time that the scheme was updated
|
java.lang.String |
getLocation()
Retrieve the location of the files that comprise the underlying storage of the scheme
|
int |
getMaxItems()
Retrieve the maximum number of items that will be considered as training data for
each category within the scheme
|
java.lang.String |
getName()
Retrieve the name of the classification scheme
|
int |
getSubsystemID()
Retrieve the ID of the classification subsystem with which this scheme
is associated
|
void |
infer(java.lang.String database,
java.lang.String fieldname)
Infer classes and training data from a previous classified database.
|
void |
infer(java.lang.String database,
java.lang.String fieldname,
int threshold)
Infer classes and training data from a previous classified database.
|
boolean |
isFinalized()
Check if the scheme has been finalized if the subsystem in use by the scheme requires
finalization; value is undefined if the subsystem does not require finalization.
|
boolean |
isOwner()
Check if the calling user is the owner of the scheme
|
java.util.Iterator<TdbCategory> |
iterator()
Retrieve an iterator over the categories defined within the scheme
|
void |
put()
Store any saved attributes of the container, e.g. new location, new comment.
|
TdbCategory |
remove(java.lang.String name)
Remove an existing category from the scheme
|
void |
remove(TdbCategory cat)
Remove an existing category from the scheme
|
void |
rename(java.lang.String newname)
Rename the current container.
|
boolean |
requiresFinalization()
Check whether this scheme requires special finalization in addition to the normal indexing process
|
void |
setDescription(java.lang.String description)
Establish a description to be associated with the scheme
|
void |
setLocation(java.lang.String loc)
Establish the location (typically a logical name) where the files that comprise the
underlying storage of the scheme should be placed
|
void |
setMaxItems(int max)
Establish the maximum number of items that will be considered as training data for
each category within the scheme
|
void |
setName(java.lang.String name)
Established the name of the classification scheme
|
void |
setSubsystemID(int id)
Establish the ID of the classification subsystem with which this scheme
is associated
|
boolean |
supportsHierarchy()
Check whether this scheme supports hierarchical classification
|
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
cancel, getSession, isCancelable, setCancelable
public TdbClassificationScheme(TdbSession session, TdbControlObject ob) throws TdbException
session
- Active sessionob
- Control object containing information about the containerTdbException
public TdbClassificationScheme(TdbSession session) throws TdbException
session
- Active sessionTdbException
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name of the classification schemepublic boolean isOwner()
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- The scheme descriptionpublic int getSubsystemID()
TdbSession.getSubsystemName(int)
,
TdbSession.getSubsystemID(String)
,
TdbSession.subsystemNames()
public void setSubsystemID(int id)
id
- Subsystem unique IDTdbSession.getSubsystemName(int)
,
TdbSession.getSubsystemID(String)
,
TdbSession.subsystemNames()
public TdbControlObject getControlObject()
getControlObject
in interface TdbControlObjectProvider
public java.util.Iterator<TdbCategory> iterator()
iterator
in interface java.lang.Iterable<TdbCategory>
public boolean supportsHierarchy()
public boolean requiresFinalization()
public java.lang.String getLastUpdate()
public java.lang.String getLastIndex()
public java.lang.String getLocation()
public void setLocation(java.lang.String loc)
loc
- File locationpublic boolean isFinalized()
public java.lang.String getAlgorithmName()
TdbSession.subsystemNames()
,
TdbSession.getSubsystemID(String)
,
TdbSession.getSubsystemName(int)
public int getMaxItems()
public void setMaxItems(int max)
max
- Maximum number of items per categorypublic void create(java.lang.String name, int subsystem, int max_items) throws TdbException
name
- The name of the new containersubsystem
- The ID of the subsystemmax_items
- The maximum number of items that will be accepted when training
the containerTdbException
public void create(java.lang.String name, int subsystem) throws TdbException
name
- The name of the new containersubsystem
- The ID of the subsystemTdbException
public void create(java.lang.String name) throws TdbException
name
- The name of the new containerTdbException
public void create() throws TdbException
TdbException
public TdbCategory add(java.lang.String name, java.lang.String comment) throws TdbException
name
- Name of the new categorycomment
- Optional comment to assign to the categoryTdbException
public TdbCategory getCategory(java.lang.String name)
name
- The name of the category to retrievepublic TdbCategory getCategory(int id) throws TdbException
id
- Unique ID of the category to retrieveTdbException
public TdbCategory remove(java.lang.String name) throws TdbException
name
- Name of category to removeTdbException
public void remove(TdbCategory cat) throws TdbException
cat
- Category to removeTdbException
public void get(java.lang.String name) throws TdbException
name
- The name of container for which to retrieve propertiesTdbException
public void get() throws TdbException
TdbException
public void put() throws TdbException
TdbException
public void delete(java.lang.String name) throws TdbException
name
- The name of the container to removeTdbException
public void delete() throws TdbException
TdbException
public void rename(java.lang.String newname) throws TdbException
newname
- The new name that the container is to assumeTdbException
public void finalizeContainer() throws TdbException
TdbException
public void classify(java.lang.String data, java.util.List<TdbCategory> categories) throws TdbException
data
- Data to test again the containercategories
- (output) The categories to which the data has been assignedTdbException
public void infer(java.lang.String database, java.lang.String fieldname, int threshold) throws TdbException
database
- Name of TRIP database from which to read training datafieldname
- Name of field within database that contains the category namethreshold
- Maximum number of items per category to read from the databaseTdbException
public void infer(java.lang.String database, java.lang.String fieldname) throws TdbException
database
- Name of TRIP database from which to read training datafieldname
- Name of field within database that contains the category nameTdbException