eu.etaxonomy.cdm.model.common
Class OrderedTermBase<T extends OrderedTermBase>

java.lang.Object
  extended by eu.etaxonomy.cdm.model.common.CdmBase
      extended by eu.etaxonomy.cdm.model.common.VersionableEntity
          extended by eu.etaxonomy.cdm.model.common.AnnotatableEntity
              extended by eu.etaxonomy.cdm.model.common.IdentifiableEntity<IIdentifiableEntityCacheStrategy>
                  extended by eu.etaxonomy.cdm.model.common.TermBase
                      extended by eu.etaxonomy.cdm.model.common.DefinedTermBase<T>
                          extended by eu.etaxonomy.cdm.model.common.OrderedTermBase<T>
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IDefinedTerm<T>, IIdentifiableEntity, ILoadableTerm<T>, ISourceable<IdentifiableSource>, IVersionableEntity, Serializable, Cloneable, Comparable<T>
Direct Known Subclasses:
Modifier, NamedArea, NamedAreaLevel, NomenclaturalStatusType, PresenceAbsenceTermBase, Rank, RelationshipTermBase, State, TypeDesignationStatusBase

@Entity
@Indexed(index="eu.etaxonomy.cdm.model.common.DefinedTermBase")
public abstract class OrderedTermBase<T extends OrderedTermBase>
extends DefinedTermBase<T>
implements Comparable<T>

Version:
1.0
Author:
m.doering
See Also:
Serialized Form

Field Summary
protected  int orderIndex
           
 
Fields inherited from class eu.etaxonomy.cdm.model.common.DefinedTermBase
partOf, vocabulary
 
Fields inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
cacheStrategy, NOT_PROTECTED, PROTECTED, protectedTitleCache, titleCache
 
Fields inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
annotations, markers
 
Fields inherited from class eu.etaxonomy.cdm.model.common.CdmBase
uuid
 
Constructor Summary
OrderedTermBase()
           
OrderedTermBase(String term, String label, String labelAbbrev)
           
 
Method Summary
 Object clone()
          Clones this OrderedTermBase.
 int compareTo(T orderedTerm)
          Compares this OrderedTermBase with the specified OrderedTermBase for order.
protected  boolean decreaseIndex(OrderedTermVocabulary<T> vocabulary)
          Deprecated. To be used only by OrderedTermVocabulary
 boolean equals(Object object)
          Is true if UUID and created timestamp are the same for the passed Object and this one.
 int getOrderIndex()
          Higher ordered terms have a lower order index, lower ordered terms have a higher order index:
protected  boolean incrementIndex(OrderedTermVocabulary<T> vocabulary)
          Deprecated. To be used only by OrderedTermVocabulary
 boolean isHigher(T orderedTerm)
          If this term is higher than the parameter term, true is returned, else false.
 boolean isLower(T orderedTerm)
          If this term is lower than the parameter term, true is returned, else false.
protected  int performCompareTo(T orderedTerm, boolean skipVocabularyCheck)
          Compares this OrderedTermBase with the specified OrderedTermBase for order.
 
Methods inherited from class eu.etaxonomy.cdm.model.common.DefinedTermBase
addGeneralizationOf, addIncludes, addMedia, getByUuid, getGeneralizationOf, getIncludes, getKindOf, getMedia, getPartOf, getVocabulary, readCsvLine, readCsvLine, removeGeneralization, removeIncludes, removeMedia, resetTerms, setDefaultTerms, setGeneralizationOf, setIncludes, setKindOf, setPartOf, setVocabulary, writeCsvLine
 
Methods inherited from class eu.etaxonomy.cdm.model.common.TermBase
addRepresentation, getDescription, getDescription, getLabel, getLabel, getPreferredRepresentation, getPreferredRepresentation, getRepresentation, getRepresentations, getUri, removeRepresentation, setLabel, setLabel, setUri, toString
 
Methods inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
addCredit, addCredit, addExtension, addExtension, addRights, addSource, addSource, compareTo, generateTitle, getCacheStrategy, getCredits, getCredits, getData, getExtensions, getExtensions, getExtensions, getLsid, getRights, getSources, getTitleCache, getTruncatedCache, initListener, isProtectedTitleCache, regenerateTitleCache, removeCredit, removeCredit, removeExtension, removeRights, removeSource, setCacheStrategy, setLsid, setProtectedTitleCache, setTitleCache, setTitleCache
 
Methods inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from class eu.etaxonomy.cdm.model.common.VersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from class eu.etaxonomy.cdm.model.common.CdmBase
addPropertyChangeListener, addPropertyChangeListener, clone, deproxy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUuid, hashCode, hasListeners, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IDefinedTerm
getUuid
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IAnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IVersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.ICdmBase
getCreated, getCreatedBy, getId, getUuid, setCreated, setCreatedBy, setId, setUuid
 

Field Detail

orderIndex

protected int orderIndex
Constructor Detail

OrderedTermBase

public OrderedTermBase()

OrderedTermBase

public OrderedTermBase(String term,
                       String label,
                       String labelAbbrev)
Method Detail

getOrderIndex

public int getOrderIndex()
Higher ordered terms have a lower order index, lower ordered terms have a higher order index:

a.oderIndex < b.oderIndex : a > b

Returns:
the order index of a term

compareTo

public int compareTo(T orderedTerm)
Compares this OrderedTermBase with the specified OrderedTermBase for order. Returns a negative integer, zero, or a positive integer as the orderId of this object is greater than, equal to, or less than the specified object. This Integer compare logic of this method is the inverse logic of the the one implemented in Comparable.compareTo(java.lang.Object)

Specified by:
compareTo in interface Comparable<T extends OrderedTermBase>

performCompareTo

protected int performCompareTo(T orderedTerm,
                               boolean skipVocabularyCheck)
Compares this OrderedTermBase with the specified OrderedTermBase for order. Returns a negative integer, zero, or a positive integer as the orderId of this object is greater than, equal to, or less than the specified object. This Integer compare logic of this method is the inverse logic of the the one implemented in Comparable.compareTo(java.lang.Object)


isLower

public boolean isLower(T orderedTerm)
If this term is lower than the parameter term, true is returned, else false. If the parameter term is null, an Exception is thrown.

Parameters:
orderedTerm -
Returns:
boolean result of the comparison

isHigher

public boolean isHigher(T orderedTerm)
If this term is higher than the parameter term, true is returned, else false. If the parameter term is null, an Exception is thrown.

Parameters:
orderedTerm -
Returns:
boolean result of the comparison

decreaseIndex

@Deprecated
protected boolean decreaseIndex(OrderedTermVocabulary<T> vocabulary)
Deprecated. To be used only by OrderedTermVocabulary


incrementIndex

@Deprecated
protected boolean incrementIndex(OrderedTermVocabulary<T> vocabulary)
Deprecated. To be used only by OrderedTermVocabulary


equals

public boolean equals(Object object)
Description copied from class: VersionableEntity
Is true if UUID and created timestamp are the same for the passed Object and this one.

Overrides:
equals in class TermBase
See Also:
See {@link http://www.hibernate.org/109.html hibernate109}, {@link http://www.geocities.com/technofundo/tech/java/equalhash.html geocities} or {@link http://www.ibm.com/developerworks/java/library/j-jtp05273.html ibm} for more information about equals and hashcode.

clone

public Object clone()
Clones this OrderedTermBase. This is a shortcut that enables to create a new instance that differs only slightly from this OrderedTermBase.

Overrides:
clone in class DefinedTermBase<T extends OrderedTermBase>
See Also:
DefinedTermBase.clone(), Object.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.