Class TdbClassificationScheme

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      void remove​(TdbCategory cat)
      Remove an existing category from the scheme
      TdbCategory remove​(java.lang.String name)
      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
      • 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 Detail

      • TdbClassificationScheme

        public TdbClassificationScheme​(TdbSession session,
                                       TdbControlObject ob)
                                throws TdbException
        Constructor, creates an object for the container referenced by the provided TdbControlObject
        Parameters:
        session - Active session
        ob - Control object containing information about the container
        Throws:
        TdbException
      • TdbClassificationScheme

        public TdbClassificationScheme​(TdbSession session)
                                throws TdbException
        Constructor, creates a blank container
        Parameters:
        session - Active session
        Throws:
        TdbException
    • Method Detail

      • getName

        public java.lang.String getName()
        Retrieve the name of the classification scheme
        Returns:
        Classification scheme name
      • setName

        public void setName​(java.lang.String name)
        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

        public java.lang.String getDescription()
        Retrieve any description associated with the scheme
        Returns:
        Scheme description, if any
      • setDescription

        public void setDescription​(java.lang.String description)
        Establish a description to be associated with the scheme
        Parameters:
        description - The scheme description
      • iterator

        public java.util.Iterator<TdbCategory> iterator()
        Retrieve an iterator over the categories defined within the scheme
        Specified by:
        iterator in interface java.lang.Iterable<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

        public java.lang.String getLastUpdate()
        Retrieve the last date / time that the scheme was updated
        Returns:
        Last update timestamp
      • getLastIndex

        public java.lang.String getLastIndex()
        Retrieve the last date / time that the scheme was indexed
        Returns:
        Last index timestamp
      • getLocation

        public java.lang.String getLocation()
        Retrieve the location of the files that comprise the underlying storage of the scheme
        Returns:
        File location
      • setLocation

        public 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
        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
      • 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

        public void create​(java.lang.String name,
                           int subsystem,
                           int max_items)
                    throws TdbException
        Create a new container, using the specified subsystem. Invoking this method causes network I/O.
        Parameters:
        name - The name of the new container
        subsystem - The ID of the subsystem
        max_items - The maximum number of items that will be accepted when training the container
        Throws:
        TdbException
      • create

        public void create​(java.lang.String name,
                           int subsystem)
                    throws TdbException
        Create a new container, using the specified subsystem. Invoking this method causes network I/O.
        Parameters:
        name - The name of the new container
        subsystem - The ID of the subsystem
        Throws:
        TdbException
      • create

        public void create​(java.lang.String name)
                    throws TdbException
        Create a new container. Invoking this method causes network I/O.
        Parameters:
        name - The name of the new container
        Throws:
        TdbException
      • add

        public TdbCategory add​(java.lang.String name,
                               java.lang.String comment)
                        throws TdbException
        Add a new category to the scheme.
        Parameters:
        name - Name of the new category
        comment - Optional comment to assign to the category
        Returns:
        The new category instance
        Throws:
        TdbException
      • getCategory

        public TdbCategory getCategory​(java.lang.String name)
        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

        public TdbCategory getCategory​(int id)
                                throws TdbException
        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

        public TdbCategory remove​(java.lang.String name)
                           throws TdbException
        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
      • get

        public void get​(java.lang.String name)
                 throws TdbException
        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

        public void get()
                 throws TdbException
        Retrieve the properties of the current container, including the list of all categories defined within it.
        Throws:
        TdbException
      • put

        public void put()
                 throws TdbException
        Store any saved attributes of the container, e.g. new location, new comment. Invoking this method causes network I/O.
        Throws:
        TdbException
      • delete

        public void delete​(java.lang.String name)
                    throws TdbException
        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

        public void delete()
                    throws TdbException
        Remove the current container from the server in its entirety. Invoking this method causes network I/O.
        Throws:
        TdbException
      • rename

        public void rename​(java.lang.String newname)
                    throws TdbException
        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

        public void finalizeContainer()
                               throws TdbException
        Finalize container training, whatever that means for the underlying subsystem. Invoking this method causes network I/O.
        Throws:
        TdbException
      • classify

        public void classify​(java.lang.String data,
                             java.util.List<TdbCategory> categories)
                      throws TdbException
        Test classification with the container. Invoking this method causes network I/O.
        Parameters:
        data - Data to test again the container
        categories - (output) The categories to which the data has been assigned
        Throws:
        TdbException
      • infer

        public void infer​(java.lang.String database,
                          java.lang.String fieldname,
                          int threshold)
                   throws TdbException
        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 data
        fieldname - Name of field within database that contains the category name
        threshold - Maximum number of items per category to read from the database
        Throws:
        TdbException
      • infer

        public void infer​(java.lang.String database,
                          java.lang.String fieldname)
                   throws TdbException
        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 data
        fieldname - Name of field within database that contains the category name
        Throws:
        TdbException