de.topicmapslab.majortom.database.jdbc.index
Class JdbcLiteralIndex

java.lang.Object
  extended by de.topicmapslab.majortom.index.IndexImpl<T>
      extended by de.topicmapslab.majortom.index.core.BaseCachedIndexImpl<X>
          extended by de.topicmapslab.majortom.index.core.BaseCachedLiteralIndexImpl<X>
              extended by de.topicmapslab.majortom.index.nonpaged.CachedLiteralIndexImpl<JdbcTopicMapStore>
                  extended by de.topicmapslab.majortom.database.jdbc.index.JdbcLiteralIndex
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, de.topicmapslab.majortom.model.index.IIndex, de.topicmapslab.majortom.model.index.ILiteralIndex, org.tmapi.index.Index, org.tmapi.index.LiteralIndex

public class JdbcLiteralIndex
extends CachedLiteralIndexImpl<JdbcTopicMapStore>

Author:
Sven Krosse

Constructor Summary
JdbcLiteralIndex(JdbcTopicMapStore store)
           
 
Method Summary
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetBooleans(boolean value)
          Returns all characteristics with the given value and the datatype xsd:boolean.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(org.tmapi.core.Locator datatype)
          Returns all characteristics with the given datatype.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.lang.String value)
          Returns all characteristics with the given value.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.lang.String value, org.tmapi.core.Locator datatype)
          Returns all characteristics with the given value and the given datatype.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.util.regex.Pattern regExp)
          Returns all characteristics which has a value matches the given regular expression.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.util.regex.Pattern regExp, org.tmapi.core.Locator datatype)
          Returns all characteristics which has a value matches the given regular expression and has the datatype.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.lang.String regExp)
          
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.lang.String regExp, org.tmapi.core.Locator datatype)
          
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCoordinates(de.topicmapslab.geotype.wgs84.Wgs84Coordinate value)
          Returns all characteristics with the given value and the datatype tm:geo.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCoordinates(de.topicmapslab.geotype.wgs84.Wgs84Coordinate value, double deviance)
          Returns all characteristics with the datatype xsd:integer and a geographical coordinate which has a lower or equal distance to the given coordinate like the given deviance.
 java.util.Collection<de.topicmapslab.majortom.model.core.IDatatypeAware> doGetDatatypeAwares(org.tmapi.core.Locator dataType)
          Returns all variants and occurrences with the given data-type.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDateTime(java.util.Calendar value)
          Returns all characteristics with the given value and the datatype xsd:dateTime.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDateTime(java.util.Calendar value, java.util.Calendar deviance)
          Returns all characteristics with the datatype xsd:time and with a time value which has a difference from the given value lower or equals than the given deviance.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDoubles(double value)
          Returns all characteristics with the given value and the datatype xsd:double.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDoubles(double value, double deviance)
          Returns all characteristics with the datatype xsd:double and a value contained by the given range [value - deviance, value + deviance].
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetFloats(float value)
          Returns all characteristics with the given value and the datatype xsd:float.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetFloats(float value, double deviance)
          Returns all characteristics with the datatype xsd:float and a value contained by the given range [value - deviance, value + deviance].
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetIntegers(int value)
          Returns all characteristics with the given value and the datatype xsd:integer.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetIntegers(int value, double deviance)
          Returns all characteristics with the datatype xsd:integer and a value contained by the given range [value - deviance, value + deviance].
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetLongs(long value)
          Returns all characteristics with the given value and the datatype xsd:long.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetLongs(long value, double deviance)
          Returns all characteristics with the datatype xsd:long and a value contained by the given range [value - deviance, value + deviance].
 java.util.Collection<org.tmapi.core.Name> doGetNames()
          Return all names contained by the current topic map.
 java.util.Collection<org.tmapi.core.Name> doGetNames(java.lang.String literal)
          Return all names contained by the current topic map with a the given literal as value.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences()
          Return all occurrences contained by the current topic map.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Locator value)
          Return all occurrences contained by the current topic map with the given value.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.lang.String literal)
          Return all occurrences contained by the current topic map with a the given literal as value.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.lang.String value, org.tmapi.core.Locator datatype)
          Return all occurrences contained by the current topic map with a the given literal as value and datatype.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetUris(java.net.URI value)
          Returns all characteristics with the given value and the datatype xsd:anyURI.
 java.util.Collection<org.tmapi.core.Variant> doGetVariants()
          Return all variants contained by the current topic map.
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(org.tmapi.core.Locator value)
          Return all variants contained by the current topic map with the given value.
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(java.lang.String value)
          Return all variants contained by the current topic map with the given literal as value.
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(java.lang.String value, org.tmapi.core.Locator datatype)
          Return all variants contained by the current topic map with a the given literal as value and datatype.
 
Methods inherited from class de.topicmapslab.majortom.index.nonpaged.CachedLiteralIndexImpl
getBooleans, getCharacteristics, getCharacteristics, getCharacteristics, getCharacteristicsMatches, getCharacteristicsMatches, getCharacteristicsMatches, getCharacteristicsMatches, getCoordinates, getCoordinates, getDatatypeAwares, getDateTime, getDateTime, getDoubles, getDoubles, getFloats, getFloats, getIntegers, getIntegers, getLongs, getLongs, getNames, getNames, getOccurrences, getOccurrences, getOccurrences, getOccurrences, getUris, getVariants, getVariants, getVariants, getVariants
 
Methods inherited from class de.topicmapslab.majortom.index.core.BaseCachedLiteralIndexImpl
cache, cache, cacheConstructs, cacheConstructs, cacheConstructs, cacheConstructs, clear, clearCache, close, open, read, read, readConstructs, readConstructs, readConstructs, readConstructs, topicMapChanged
 
Methods inherited from class de.topicmapslab.majortom.index.core.BaseCachedIndexImpl
isCachingEnabled, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext
 
Methods inherited from class de.topicmapslab.majortom.index.IndexImpl
getTopicMapStore, isAutoUpdated, isOpen, reindex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.topicmapslab.majortom.model.index.IIndex
clear
 
Methods inherited from interface org.tmapi.index.Index
close, isAutoUpdated, isOpen, open, reindex
 

Constructor Detail

JdbcLiteralIndex

public JdbcLiteralIndex(JdbcTopicMapStore store)
Parameters:
store -
Method Detail

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames()
Return all names contained by the current topic map.

Specified by:
doGetNames in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Returns:
all names of the topic map

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(java.lang.String literal)
Return all names contained by the current topic map with a the given literal as value.

Specified by:
doGetNames in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
literal - the literal
Returns:
all names of the topic map with the given literal as value

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences()
Return all occurrences contained by the current topic map.

Specified by:
doGetOccurrences in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Returns:
all occurrences of the topic map

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.lang.String literal)
Return all occurrences contained by the current topic map with a the given literal as value.

Specified by:
doGetOccurrences in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
literal - the literal
Returns:
all occurrences of the topic map with the given literal as value

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Locator value)
Return all occurrences contained by the current topic map with the given value.

Specified by:
doGetOccurrences in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
all occurrences of the topic map with the given value

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.lang.String value,
                                                                        org.tmapi.core.Locator datatype)
Return all occurrences contained by the current topic map with a the given literal as value and datatype.

Specified by:
doGetOccurrences in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the literal
datatype - the datatype
Returns:
all occurrences of the topic map with the given literal as value and datatype

doGetBooleans

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetBooleans(boolean value)
Returns all characteristics with the given value and the datatype xsd:boolean.

Specified by:
doGetBooleans in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the boolean value

doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.lang.String value)
Returns all characteristics with the given value.

Specified by:
doGetCharacteristics in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value of the characteristics
Returns:
the characteristics

doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(org.tmapi.core.Locator datatype)
Returns all characteristics with the given datatype.

Specified by:
doGetCharacteristics in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
datatype - the datatype
Returns:
the characteristics

doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.lang.String value,
                                                                                                       org.tmapi.core.Locator datatype)
Returns all characteristics with the given value and the given datatype.

Specified by:
doGetCharacteristics in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value of the characteristics
datatype - the datatype
Returns:
the characteristics

doGetCharacteristicsMatches

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.lang.String regExp)


doGetCharacteristicsMatches

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.lang.String regExp,
                                                                                                              org.tmapi.core.Locator datatype)


doGetCharacteristicsMatches

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.util.regex.Pattern regExp)
Returns all characteristics which has a value matches the given regular expression.

Specified by:
doGetCharacteristicsMatches in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
regExp - the regular expression
Returns:
the characteristics with matching values

doGetCharacteristicsMatches

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristicsMatches(java.util.regex.Pattern regExp,
                                                                                                              org.tmapi.core.Locator datatype)
Returns all characteristics which has a value matches the given regular expression and has the datatype.

Specified by:
doGetCharacteristicsMatches in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
regExp - the regular expression
datatype - the datatype
Returns:
the characteristics with matching values

doGetCoordinates

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCoordinates(de.topicmapslab.geotype.wgs84.Wgs84Coordinate value)
Returns all characteristics with the given value and the datatype tm:geo.

Specified by:
doGetCoordinates in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the geographic coordinates

doGetCoordinates

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCoordinates(de.topicmapslab.geotype.wgs84.Wgs84Coordinate value,
                                                                                                   double deviance)
Returns all characteristics with the datatype xsd:integer and a geographical coordinate which has a lower or equal distance to the given coordinate like the given deviance.

Hint:Currently not supported!

Specified by:
doGetCoordinates in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
deviance - the maximum distance
Returns:
the characteristics

doGetDatatypeAwares

public java.util.Collection<de.topicmapslab.majortom.model.core.IDatatypeAware> doGetDatatypeAwares(org.tmapi.core.Locator dataType)
Returns all variants and occurrences with the given data-type.

Specified by:
doGetDatatypeAwares in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
dataType - the data type
Returns:
a collection of all matching variants and occurrences within the given range

doGetDateTime

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDateTime(java.util.Calendar value)
Returns all characteristics with the given value and the datatype xsd:dateTime.

Specified by:
doGetDateTime in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the dateTime value

doGetDateTime

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDateTime(java.util.Calendar value,
                                                                                                java.util.Calendar deviance)
Returns all characteristics with the datatype xsd:time and with a time value which has a difference from the given value lower or equals than the given deviance. The given deviance calendar will be interpreted as maximum difference from the given value. Each time information handled as difference. For example if the difference should be lower than one day, one hour and 10 minutes the dateTime literal should be 0000-00-01T01:10:00.

Specified by:
doGetDateTime in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
deviance - the maximum difference
Returns:
the characteristics with the time value

doGetDoubles

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDoubles(double value)
Returns all characteristics with the given value and the datatype xsd:double.

Specified by:
doGetDoubles in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the double value

doGetDoubles

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetDoubles(double value,
                                                                                               double deviance)
Returns all characteristics with the datatype xsd:double and a value contained by the given range [value - deviance, value + deviance].

Specified by:
doGetDoubles in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
deviance - the maximum difference
Returns:
the characteristics

doGetFloats

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetFloats(float value)
Returns all characteristics with the given value and the datatype xsd:float.

Specified by:
doGetFloats in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the float value

doGetFloats

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetFloats(float value,
                                                                                              double deviance)
Returns all characteristics with the datatype xsd:float and a value contained by the given range [value - deviance, value + deviance].

Specified by:
doGetFloats in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
deviance - the maximum difference
Returns:
the characteristics

doGetIntegers

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetIntegers(int value)
Returns all characteristics with the given value and the datatype xsd:integer.

Specified by:
doGetIntegers in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the integer value

doGetIntegers

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetIntegers(int value,
                                                                                                double deviance)
Returns all characteristics with the datatype xsd:integer and a value contained by the given range [value - deviance, value + deviance].

Specified by:
doGetIntegers in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
deviance - the maximum difference
Returns:
the characteristics

doGetLongs

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetLongs(long value)
Returns all characteristics with the given value and the datatype xsd:long.

Specified by:
doGetLongs in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the long value

doGetLongs

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetLongs(long value,
                                                                                             double deviance)
Returns all characteristics with the datatype xsd:long and a value contained by the given range [value - deviance, value + deviance].

Specified by:
doGetLongs in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
deviance - the maximum difference
Returns:
the characteristics

doGetUris

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetUris(java.net.URI value)
Returns all characteristics with the given value and the datatype xsd:anyURI.

Specified by:
doGetUris in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
the characteristics with the URI value

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants()
Return all variants contained by the current topic map.

Specified by:
doGetVariants in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Returns:
all variants of the topic map

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(java.lang.String value)
Return all variants contained by the current topic map with the given literal as value.

Specified by:
doGetVariants in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the literal
Returns:
all variants of the topic map with the given literal as value

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(org.tmapi.core.Locator value)
Return all variants contained by the current topic map with the given value.

Specified by:
doGetVariants in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the value
Returns:
all variants of the topic map with the given value

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(java.lang.String value,
                                                                  org.tmapi.core.Locator datatype)
Return all variants contained by the current topic map with a the given literal as value and datatype.

Specified by:
doGetVariants in class CachedLiteralIndexImpl<JdbcTopicMapStore>
Parameters:
value - the literal
datatype - the datatype
Returns:
all variants of the topic map with the given literal as value and datatype