com.apelon.dts.client.concept
Class DTSConcept

java.lang.Object
  extended by com.apelon.dts.client.common.DTSObject
      extended by com.apelon.dts.client.attribute.PropertiedObject
          extended by com.apelon.dts.client.concept.DTSConcept
All Implemented Interfaces:
MatchItem, Cloneable
Direct Known Subclasses:
OntylogConcept

public class DTSConcept
extends PropertiedObject
implements MatchItem

A DTS concept is the basic unit of information in the terminology knowledgebasebase. The knowledgebase consists of a collection of DTS concepts. A DTS concept may either be an Ontylog concept or a thesaurus concept. The DTSConcept class encompasses traits common to both types of concepts.

Copyright: Copyright (c) 2003

Company: Apelon, Inc.

Since:
DTS 3.0.0
Version:
DTS 3.0.0
Author:
Apelon, Inc.

Constructor Summary
DTSConcept(String name, int namespaceId)
          Constructs a concept and assigns the code and id.
DTSConcept(String name, int id, String code, int namespaceId)
          Constructs a concept which has a name, code, ID, and namespace ID.
DTSConcept(String name, String code, int namespaceId)
          Constructs a concept and assigns the id.
 
Method Summary
 boolean addConceptAssociation(ConceptAssociation conceptAssoc)
          Adds the specified element as concept association for this concept.
 boolean addInverseConceptAssociation(ConceptAssociation invConceptAssoc)
          Adds the specified element as inverse concept association for this concept.
 boolean addSynonym(Synonym syn)
          Adds the specified element as synonym for this concept.
 boolean containsConceptAssociation(ConceptAssociation conceptAssoc)
          Tests if this concept already has the specified concept association.
 boolean containsInverseConceptAssociation(ConceptAssociation invConceptAssoc)
          Tests if this concept already has the specified inverse concept association.
 boolean containsSynonym(Synonym syn)
          Tests if this concept already has the specified synonym.
 boolean deleteConceptAssociation(ConceptAssociation conceptAssoc)
          Deletes the specified element as concept association for this concept.
 boolean deleteInverseConceptAssociation(ConceptAssociation invConceptAssoc)
          Deletes the specified element as inverse concept association for this concept.
 boolean deleteSynonym(Synonym syn)
          Deletes the specified element as synonym for this concept.
 boolean equals(Object obj)
          Compares this DTSConcept to the specified object.
 ConceptAssociation[] getFetchedConceptAssociations()
          Gets the concept associations which have been fetched for this concept.
 ConceptAssociation[] getFetchedInverseConceptAssociations()
          Gets the inverse concept associations which have been fetched for this concept.
 Synonym getFetchedPreferredTerm()
          Gets the synonym association which is the preferred term for this concept.
 Synonym[] getFetchedSynonyms()
          Gets the synonym terms which have been fetched for this concept.
 MatchItemType getMatchItemType()
          Gets the match item type, i.e.
 String getMatchString()
          Gets the string that was matched.
 int getNumberOfSpecifiedConceptAssociations()
          Get the number of concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.
 int getNumberOfSpecifiedInverseConceptAssociations()
          Get the number of inverse concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.
 int getNumberOfSpecifiedSynonyms()
          Get the number of synonyms that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.
 void setNumberOfSpecifiedConceptAssociations(int count)
          Set the number of concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.
 void setNumberOfSpecifiedInverseConceptAssociations(int count)
          Set the number of inverse concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.
 void setNumberOfSpecifiedSynonyms(int count)
          Set the number of synonyms that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.
 
Methods inherited from class com.apelon.dts.client.attribute.PropertiedObject
addProperty, containsProperty, deleteProperty, getFetchedProperties, getNumberOfSpecifiedProperties, getProperties, setProperties
 
Methods inherited from class com.apelon.dts.client.common.DTSObject
getCode, getId, getName, getNamespaceId, hashCode, setCode, setId, setName, setNamespaceId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DTSConcept

public DTSConcept(String name,
                  int id,
                  String code,
                  int namespaceId)
Constructs a concept which has a name, code, ID, and namespace ID.

Parameters:
name - name of the term
id - ID of the term
code - code of the term
namespaceId - ID of the term's namespace

DTSConcept

public DTSConcept(String name,
                  int namespaceId)
Constructs a concept and assigns the code and id. The actual values for these attributes will be generated when the concept is saved to the server.

Parameters:
name - name of the term
namespaceId - ID of the term's namespace
See Also:
BaseLocalConceptQuery.addConcept(DTSConcept)

DTSConcept

public DTSConcept(String name,
                  String code,
                  int namespaceId)
Constructs a concept and assigns the id. The actual value for the id will be generated when the concept is saved to the server; the provided concept name and code will be saved.

Parameters:
name - name of the term
namespaceId - ID of the term's namespace
See Also:
BaseLocalConceptQuery.addConcept(DTSConcept)
Method Detail

getMatchString

public String getMatchString()
Gets the string that was matched.

Specified by:
getMatchString in interface MatchItem
Returns:
the concept name

getMatchItemType

public MatchItemType getMatchItemType()
Gets the match item type, i.e. "Concept"

Specified by:
getMatchItemType in interface MatchItem
Returns:
MatchItemType for concept

getFetchedConceptAssociations

public ConceptAssociation[] getFetchedConceptAssociations()
Gets the concept associations which have been fetched for this concept. If a concept association is qualified, it will be returned as a QualifiedConceptAssociation.

Returns:
the associations for this concept

getNumberOfSpecifiedConceptAssociations

public int getNumberOfSpecifiedConceptAssociations()
Get the number of concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.

Returns:
number of concept associations of the specified types

setNumberOfSpecifiedConceptAssociations

public void setNumberOfSpecifiedConceptAssociations(int count)
Set the number of concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.

Parameters:
count - number of concept associations of the types specified in ConceptAttributeSetDescriptor

getFetchedInverseConceptAssociations

public ConceptAssociation[] getFetchedInverseConceptAssociations()
Gets the inverse concept associations which have been fetched for this concept. If a concept association is qualified, it will be returned as a QualifiedConceptAssociation.

Returns:
the associations to this concept

getNumberOfSpecifiedInverseConceptAssociations

public int getNumberOfSpecifiedInverseConceptAssociations()
Get the number of inverse concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.

Returns:
number of inverse concept associations of the specified types

setNumberOfSpecifiedInverseConceptAssociations

public void setNumberOfSpecifiedInverseConceptAssociations(int count)
Set the number of inverse concept associations that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.

Parameters:
count - number of inverse concept associations of the types specified in ConceptAttributeSetDescriptor

getFetchedSynonyms

public Synonym[] getFetchedSynonyms()
Gets the synonym terms which have been fetched for this concept. If a synonym term is qualified, it will be returned as a QualifiedTerm within the Synonym object.

Returns:
the synonym term associations for this concept

getNumberOfSpecifiedSynonyms

public int getNumberOfSpecifiedSynonyms()
Get the number of synonyms that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.

Returns:
number of synonyms of the specified types

setNumberOfSpecifiedSynonyms

public void setNumberOfSpecifiedSynonyms(int count)
Set the number of synonyms that are available of the types specified in the ConceptAttributeSetDescriptor used to obtain this DTSConcept.

Parameters:
count - number of synonyms of the types specified in ConceptAttributeSetDescriptor

getFetchedPreferredTerm

public Synonym getFetchedPreferredTerm()
Gets the synonym association which is the preferred term for this concept. This is one marked with the preferred flag (see Synonym.isPreferred()). This should be available if a ConceptAttributeSetDescriptor specified that synonyms were to be fetched.

Returns:
the synonym which is the preferred term.

addConceptAssociation

public boolean addConceptAssociation(ConceptAssociation conceptAssoc)
Adds the specified element as concept association for this concept.

Parameters:
conceptAssoc - ConceptAssociation to add
Returns:
false if the concept already had the concept association; true if the concept association was added

containsConceptAssociation

public boolean containsConceptAssociation(ConceptAssociation conceptAssoc)
Tests if this concept already has the specified concept association.

Parameters:
conceptAssoc - the ConceptAssociation to test
Returns:
true if this concept contains the concept association argument; otherwise false

deleteConceptAssociation

public boolean deleteConceptAssociation(ConceptAssociation conceptAssoc)
Deletes the specified element as concept association for this concept.

Parameters:
conceptAssoc - ConceptAssociation to delete
Returns:
true if removed successfully; otherwise false

addSynonym

public boolean addSynonym(Synonym syn)
Adds the specified element as synonym for this concept. If the synonym added is preferred, then the preferred synonym for the concept will be set.

Parameters:
syn - Synonym to add
Returns:
false if the concept already had the synonym or the synonym was null; true if the synonym was added

containsSynonym

public boolean containsSynonym(Synonym syn)
Tests if this concept already has the specified synonym.

Parameters:
syn - the Synonym to test
Returns:
true if this concept contains the synonym argument; otherwise false

deleteSynonym

public boolean deleteSynonym(Synonym syn)
Deletes the specified element as synonym for this concept. If the deleted synonym was the preferred synonym for this concept, another synonym whose preferred flag is set is chosen as the preferred. The existence of such an alternate preferred synonym is only possible with data loaded through other means than the DTS API, therefore the normal result is that the preferred synonym field is set to null.

Parameters:
syn - Synonym to delete
Returns:
true if removed successfully; otherwise false

addInverseConceptAssociation

public boolean addInverseConceptAssociation(ConceptAssociation invConceptAssoc)
Adds the specified element as inverse concept association for this concept.

Parameters:
invConceptAssoc - inverse ConceptAssociation to add
Returns:
false if the concept already had the inverse concept association; true if the inverse concept association was added

containsInverseConceptAssociation

public boolean containsInverseConceptAssociation(ConceptAssociation invConceptAssoc)
Tests if this concept already has the specified inverse concept association.

Parameters:
invConceptAssoc - the inverse ConceptAssociation to test
Returns:
true if this concept contains the inverse concept association argument; otherwise false

deleteInverseConceptAssociation

public boolean deleteInverseConceptAssociation(ConceptAssociation invConceptAssoc)
Deletes the specified element as inverse concept association for this concept.

Parameters:
invConceptAssoc - inverse ConceptAssociation to delete
Returns:
true if removed successfully; otherwise false

equals

public boolean equals(Object obj)
Compares this DTSConcept to the specified object.

Overrides:
equals in class DTSObject
Parameters:
obj - the object to compare this String against.
Returns:
true if the object is equal to the DTSConcept; false otherwise.


Copyright © 2011. All Rights Reserved.