Class AbstractTinkerIndex<T extends Element>
java.lang.Object
org.apache.tinkerpop.gremlin.tinkergraph.structure.AbstractTinkerIndex<T>
- Type Parameters:
T- type ofElementto be indexed
Storage for indexes that can be used by different implementations of
AbstractTinkerGraph.- Author:
- Valentyn Kahamlyk
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTinkerIndex(AbstractTinkerGraph graph, Class<T> indexClass) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidautoUpdate(String key, Object newValue, Object oldValue, T element) Update index for single property of element.abstract longGet count of elements which have a property with the desired value.abstract voidcreateKeyIndex(String key) Create new indexabstract voiddropKeyIndex(String key) Drop indexGet list of elements which have a property with the desired value.Get all index keys for Graphstatic ObjectProvides a way for an index to have anullvalue asConcurrentHashMapwill not allow anullkey.abstract voidRemove elements with some property from index.abstract voidremoveElement(T element) Remove elements from all indexes.
-
Field Details
-
indexClass
-
graph
-
indexedKeys
-
-
Constructor Details
-
AbstractTinkerIndex
-
-
Method Details
-
get
Get list of elements which have a property with the desired value.- Parameters:
key- property keyvalue- property value- Returns:
- list of elements
-
count
Get count of elements which have a property with the desired value.- Parameters:
key- property keyvalue- property value- Returns:
- count of elements
-
remove
Remove elements with some property from index. Convenient to use when removed only one property of an element.- Parameters:
key- property keyvalue- property valueelement- changed element
-
removeElement
Remove elements from all indexes. Can be used when element was deleted or has changed more than 1 property.- Parameters:
element- changed element
-
autoUpdate
Update index for single property of element.- Parameters:
key- property keynewValue- updated value of propertyoldValue- optional value of property before updateelement- changed element
-
createKeyIndex
Create new index- Parameters:
key- property key
-
dropKeyIndex
Drop index- Parameters:
key- property key
-
getIndexedKeys
Get all index keys for Graph- Returns:
- set of index keys
-
indexable
Provides a way for an index to have anullvalue asConcurrentHashMapwill not allow anullkey.
-