Class TdbClassificationScheme
java.lang.Object
com.tietoenator.trip.jxp.session.TdbSessionObject
com.tietoenator.trip.jxp.TdbMessageProvider
com.tietoenator.trip.jxp.classification.TdbClassificationScheme
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
,TdbControlObjectProvider
,Iterable<TdbCategory>
public class TdbClassificationScheme
extends TdbMessageProvider
implements com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider, Iterable<TdbCategory>
Container and manipulation logic for a classification scheme container database
-
Constructor Summary
ConstructorsConstructorDescriptionTdbClassificationScheme
(TdbSession session) Constructor, creates a blank containerTdbClassificationScheme
(TdbSession session, TdbControlObject ob) Constructor, creates an object for the container referenced by the provided TdbControlObject -
Method Summary
Modifier and TypeMethodDescriptionAdd a new category to the scheme.void
classify
(String data, List<TdbCategory> categories) Test classification with the container.void
create()
Create a new containervoid
Create a new container.void
Create a new container, using the specified subsystem.void
Create a new container, using the specified subsystem.void
delete()
Remove the current container from the server in its entirety.void
Remove a container from the server in its entirety.void
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
Retrieve the properties of a container, including the list of all categories defined within it.Retrieve the name of the algorithm, or classification subsystem, used to create the schemegetCategory
(int id) Retrieve the category with the provided unique ID, if found.getCategory
(String name) Retrieve the category with the provided name, if found.Retrieve the Control object reference with which this instance was constructedRetrieve any description associated with the schemeRetrieve the last date / time that the scheme was indexedRetrieve the last date / time that the scheme was updatedRetrieve the location of the files that comprise the underlying storage of the schemeint
Retrieve the maximum number of items that will be considered as training data for each category within the schemegetName()
Retrieve the name of the classification schemeint
Retrieve the ID of the classification subsystem with which this scheme is associatedvoid
Infer classes and training data from a previous classified database.void
Infer classes and training data from a previous classified database.boolean
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 schemeiterator()
Retrieve an iterator over the categories defined within the schemevoid
put()
Store any saved attributes of the container, e.g. new location, new comment.void
remove
(TdbCategory cat) Remove an existing category from the schemeRemove an existing category from the schemevoid
Rename the current container.boolean
Check whether this scheme requires special finalization in addition to the normal indexing processvoid
setDescription
(String description) Establish a description to be associated with the schemevoid
setLocation
(String loc) Establish the location (typically a logical name) where the files that comprise the underlying storage of the scheme should be placedvoid
setMaxItems
(int max) Establish the maximum number of items that will be considered as training data for each category within the schemevoid
Established the name of the classification schemevoid
setSubsystemID
(int id) Establish the ID of the classification subsystem with which this scheme is associatedboolean
Check whether this scheme supports hierarchical classificationMethods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject
cancel, getSession, isCancelable, setCancelable
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TdbClassificationScheme
Constructor, creates an object for the container referenced by the provided TdbControlObject- Parameters:
session
- Active sessionob
- Control object containing information about the container- Throws:
TdbException
-
TdbClassificationScheme
Constructor, creates a blank container- Parameters:
session
- Active session- Throws:
TdbException
-
-
Method Details
-
getName
Retrieve the name of the classification scheme- Returns:
- Classification scheme name
-
setName
Established the name of the classification scheme- Parameters:
name
- The name of the classification scheme
-
isOwner
public boolean isOwner()Check if the calling user is the owner of the scheme- Returns:
- true if the calling user is the owner of the scheme
-
getDescription
Retrieve any description associated with the scheme- Returns:
- Scheme description, if any
-
setDescription
Establish a description to be associated with the scheme- Parameters:
description
- The scheme description
-
getSubsystemID
public int getSubsystemID()Retrieve the ID of the classification subsystem with which this scheme is associated- Returns:
- Subsystem unique ID
- See Also:
-
setSubsystemID
public void setSubsystemID(int id) Establish the ID of the classification subsystem with which this scheme is associated- Parameters:
id
- Subsystem unique ID- See Also:
-
getControlObject
Retrieve the Control object reference with which this instance was constructed- Specified by:
getControlObject
in interfaceTdbControlObjectProvider
- Returns:
- Control object reference
-
iterator
Retrieve an iterator over the categories defined within the scheme- Specified by:
iterator
in interfaceIterable<TdbCategory>
- Returns:
- iterator for use with the "for-each" pattern
-
supportsHierarchy
public boolean supportsHierarchy()Check whether this scheme supports hierarchical classification- Returns:
- true / false
-
requiresFinalization
public boolean requiresFinalization()Check whether this scheme requires special finalization in addition to the normal indexing process- Returns:
- true / false
-
getLastUpdate
Retrieve the last date / time that the scheme was updated- Returns:
- Last update timestamp
-
getLastIndex
Retrieve the last date / time that the scheme was indexed- Returns:
- Last index timestamp
-
getLocation
Retrieve the location of the files that comprise the underlying storage of the scheme- Returns:
- File location
-
setLocation
Establish the location (typically a logical name) where the files that comprise the underlying storage of the scheme should be placed- Parameters:
loc
- File location
-
isFinalized
public 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.- Returns:
- true / false
-
getAlgorithmName
Retrieve the name of the algorithm, or classification subsystem, used to create the scheme- Returns:
- Subsystem name
- See Also:
-
getMaxItems
public int getMaxItems()Retrieve the maximum number of items that will be considered as training data for each category within the scheme- Returns:
- Max items per category
-
setMaxItems
public void setMaxItems(int max) Establish the maximum number of items that will be considered as training data for each category within the scheme- Parameters:
max
- Maximum number of items per category
-
create
Create a new container, using the specified subsystem. Invoking this method causes network I/O.- Parameters:
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 container- Throws:
TdbException
-
create
Create a new container, using the specified subsystem. Invoking this method causes network I/O.- Parameters:
name
- The name of the new containersubsystem
- The ID of the subsystem- Throws:
TdbException
-
create
Create a new container. Invoking this method causes network I/O.- Parameters:
name
- The name of the new container- Throws:
TdbException
-
create
Create a new container- Throws:
TdbException
-
add
Add a new category to the scheme.- Parameters:
name
- Name of the new categorycomment
- Optional comment to assign to the category- Returns:
- The new category instance
- Throws:
TdbException
-
getCategory
Retrieve the category with the provided name, if found. This method is only usable after the get() method has been used successfully.- Parameters:
name
- The name of the category to retrieve- Returns:
- The category instance, or null if not found
-
getCategory
Retrieve the category with the provided unique ID, if found. This method is only usable after the get() method has been used successfully.- Parameters:
id
- Unique ID of the category to retrieve- Returns:
- The category instance, or null if not found
- Throws:
TdbException
-
remove
Remove an existing category from the scheme- Parameters:
name
- Name of category to remove- Returns:
- The category instance that was removed, if found
- Throws:
TdbException
-
remove
Remove an existing category from the scheme- Parameters:
cat
- Category to remove- Throws:
TdbException
-
get
Retrieve the properties of a container, including the list of all categories defined within it. Invoking this method causes network I/O.- Parameters:
name
- The name of container for which to retrieve properties- Throws:
TdbException
-
get
Retrieve the properties of the current container, including the list of all categories defined within it.- Throws:
TdbException
-
put
Store any saved attributes of the container, e.g. new location, new comment. Invoking this method causes network I/O.- Throws:
TdbException
-
delete
Remove a container from the server in its entirety. Invoking this method causes network I/O.- Parameters:
name
- The name of the container to remove- Throws:
TdbException
-
delete
Remove the current container from the server in its entirety. Invoking this method causes network I/O.- Throws:
TdbException
-
rename
Rename the current container. Invoking this method causes network I/O.- Parameters:
newname
- The new name that the container is to assume- Throws:
TdbException
-
finalizeContainer
Finalize container training, whatever that means for the underlying subsystem. Invoking this method causes network I/O.- Throws:
TdbException
-
classify
Test classification with the container. Invoking this method causes network I/O.- Parameters:
data
- Data to test again the containercategories
- (output) The categories to which the data has been assigned- Throws:
TdbException
-
infer
Infer classes and training data from a previous classified database. Invoking this method causes network I/O.- Parameters:
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 database- Throws:
TdbException
-
infer
Infer classes and training data from a previous classified database. Invoking this method causes network I/O.- Parameters:
database
- Name of TRIP database from which to read training datafieldname
- Name of field within database that contains the category name- Throws:
TdbException
-