org.universAAL.middleware.owl
Class ComparableIndividual

Package class diagram package ComparableIndividual
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.owl.ManagedIndividual
              extended by org.universAAL.middleware.owl.ComparableIndividual
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
AbsLocation, LevelRating, PrivacyLevel, Rating

public abstract class ComparableIndividual
extends ManagedIndividual
implements Comparable

Represents the class of individuals that can be compared to other individuals for finding out their (partial) order. The conventions described for the class hierarchy rooted at ManagedIndividual; in particular, the subclasses must override the following non-final static methods: getMaximum() and getMinimum().

Author:
mtazari - Saied Tazari, Carsten Stockloew

Field Summary
static String MY_URI
           
static int NON_COMPARABLE_INDIVIDUALS
          To be used in the implementation of Comparable.compareTo(Object), if the passed parameter is not comparable with the current individual.
 
Fields inherited from class org.universAAL.middleware.owl.ManagedIndividual
OWL_NAMESPACE, TYPE_OWL_INDIVIDUAL, TYPE_OWL_THING
 
Fields inherited from class org.universAAL.middleware.rdf.Resource
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, ns_delim_index, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, PROP_uAAL_INVOLVED_HUMAN_USER, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uAAL_NAMESPACE_PREFIX, uAAL_SERVICE_NAMESPACE, uAAL_VOCABULARY_NAMESPACE, uri
 
Constructor Summary
protected ComparableIndividual()
           
protected ComparableIndividual(String uri)
           
 
Method Summary
abstract  int compareTo(Object arg0)
          Compare this object to the given object.
 boolean equal(Object other)
          Determines if this object equals the given object.
 ComparableIndividual getClassMaximum()
           
static ComparableIndividual getClassMaximum(Class claz)
           
 ComparableIndividual getClassMinimum()
           
static ComparableIndividual getClassMinimum(Class claz)
           
 String getClassURI()
          Get the class URI for this ManagedIndividual.
static ComparableIndividual getMaximum()
          Returns the "largest" instance in this class, if it exists.
static ComparableIndividual getMinimum()
          Returns the "smallest" instance in this class, if it exists.
abstract  ComparableIndividual getNext()
          Get the next value according to the total order of this comparable individual.
abstract  ComparableIndividual getPrevious()
          Get the previous value according to the total order of this comparable individual.
 boolean greater(Object other)
          Determines if this object is greater than the given object.
 boolean greaterEqual(Object other)
          Determines if this object is greater than or equals the given object.
 boolean less(Object other)
          Determines if this object is smaller than the given object.
 boolean lessEqual(Object other)
          Determines if this object is smaller than or equals the given object.
abstract  int ord()
          If there is a total strict order between the class members, then it must return the "serial number" of this instance, otherwise Integer.MIN_VALUE must be returned.
 
Methods inherited from class org.universAAL.middleware.owl.ManagedIndividual
checkCompatibility, checkMembership, copy, deepCopy, getClassRestrictionsOnProperty, getInstance, getNonAbstractSuperClasses, getNonabstractSuperClasses, getOntClassInfo, getPropSerializationType, getTypeURI, isRegisteredClassURI, isWellFormed, setProperty, setPropertyPathFromOffset, toManagedIndividual
 
Methods inherited from class org.universAAL.middleware.rdf.FinalizedResource
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
 
Methods inherited from class org.universAAL.middleware.rdf.Resource
addMultiLangProp, asList, asList, asRDFList, changeProperty, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NON_COMPARABLE_INDIVIDUALS

public static final int NON_COMPARABLE_INDIVIDUALS
To be used in the implementation of Comparable.compareTo(Object), if the passed parameter is not comparable with the current individual.

See Also:
Constant Field Values

MY_URI

public static final String MY_URI
See Also:
Constant Field Values
Constructor Detail

ComparableIndividual

protected ComparableIndividual()

ComparableIndividual

protected ComparableIndividual(String uri)
Method Detail

getClassURI

public String getClassURI()
Description copied from class: ManagedIndividual
Get the class URI for this ManagedIndividual. All non-abstract subclasses MUST overwrite this method!

Overrides:
getClassURI in class ManagedIndividual
Returns:
The class URI.

getClassMaximum

public static final ComparableIndividual getClassMaximum(Class claz)

getClassMinimum

public static final ComparableIndividual getClassMinimum(Class claz)

getMaximum

public static ComparableIndividual getMaximum()
Returns the "largest" instance in this class, if it exists.


getMinimum

public static ComparableIndividual getMinimum()
Returns the "smallest" instance in this class, if it exists.


compareTo

public abstract int compareTo(Object arg0)
Compare this object to the given object.

Specified by:
compareTo in interface Comparable
Returns:
0if current location and argument location are in the same Place.
-1 if current location is in a Place contained in argument location Place.
1 if argument location is in a Place contained in current location Place.
NON_COMPARABLE_INDIVIDUALS if two locations are not comparable.

getClassMaximum

public final ComparableIndividual getClassMaximum()

getClassMinimum

public final ComparableIndividual getClassMinimum()

getNext

public abstract ComparableIndividual getNext()
Get the next value according to the total order of this comparable individual.

Returns:
the next value

getPrevious

public abstract ComparableIndividual getPrevious()
Get the previous value according to the total order of this comparable individual.

Returns:
the previous value

equal

public final boolean equal(Object other)
Determines if this object equals the given object.


greater

public final boolean greater(Object other)
Determines if this object is greater than the given object.


greaterEqual

public final boolean greaterEqual(Object other)
Determines if this object is greater than or equals the given object.


less

public final boolean less(Object other)
Determines if this object is smaller than the given object.


lessEqual

public final boolean lessEqual(Object other)
Determines if this object is smaller than or equals the given object.


ord

public abstract int ord()
If there is a total strict order between the class members, then it must return the "serial number" of this instance, otherwise Integer.MIN_VALUE must be returned.



Copyright © 2014 universAAL Consortium. All Rights Reserved.