|
Neo4j Community | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neo4j.tooling.wrap.WrappedIndex<T,I>
public abstract class WrappedIndex<T extends PropertyContainer,I extends ReadableIndex<T>>
Nested Class Summary | |
---|---|
static class |
WrappedIndex.WrappedNodeIndex
|
static class |
WrappedIndex.WrappedRelationshipIndex
|
Method Summary | |
---|---|
protected abstract I |
actual()
|
void |
add(T entity,
String key,
Object value)
Adds a key/value pair for entity to the index. |
void |
delete()
Clears the index and deletes the configuration associated with it. |
IndexHits<T> |
get(String key,
Object value)
Returns exact matches from this index, given the key/value pair. |
Class<T> |
getEntityType()
|
GraphDatabaseService |
getGraphDatabase()
Get the graph database that owns this index. |
String |
getName()
|
boolean |
isWriteable()
A ReadableIndex is possible to support mutating operations as well. |
T |
putIfAbsent(T entity,
String key,
Object value)
Add the entity to this index for the given key/value pair if this particular key/value pair doesn't already exist. |
IndexHits<T> |
query(Object queryOrQueryObject)
Returns matches from this index based on the supplied query object, which can be a query string or an implementation-specific query object. |
IndexHits<T> |
query(String key,
Object queryOrQueryObject)
Returns matches from this index based on the supplied key and
query object, which can be a query string or an implementation-specific
query object. |
void |
remove(T entity)
Removes an entity from the index and all its key/value pairs which has been previously associated using Index.add(PropertyContainer, String, Object) . |
void |
remove(T entity,
String key)
Removes key/value pairs for entity where key is key
from the index. |
void |
remove(T entity,
String key,
Object value)
Removes a key/value pair for entity from the index. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
protected abstract I actual()
public GraphDatabaseService getGraphDatabase()
ReadableIndex
graph database
that owns this index.
getGraphDatabase
in interface ReadableIndex<T extends PropertyContainer>
graph database
that owns this index.public String toString()
toString
in class Object
public String getName()
getName
in interface ReadableIndex<T extends PropertyContainer>
public Class<T> getEntityType()
getEntityType
in interface ReadableIndex<T extends PropertyContainer>
public void add(T entity, String key, Object value)
Index
entity
to the index. If that key/value
pair for the entity is already in the index it's up to the
implementation to make it so that such an operation is idempotent.
add
in interface Index<T extends PropertyContainer>
entity
- the entity (i.e Node
or Relationship
)
to associate the key/value pair with.key
- the key in the key/value pair to associate with the entity.value
- the value in the key/value pair to associate with the
entity.public void remove(T entity, String key, Object value)
Index
entity
from the index. If that
key/value pair isn't associated with entity
in this index this
operation doesn't do anything.
remove
in interface Index<T extends PropertyContainer>
entity
- the entity (i.e Node
or Relationship
)
to dissociate the key/value pair from.key
- the key in the key/value pair to dissociate from the entity.value
- the value in the key/value pair to dissociate from the
entity.public void remove(T entity, String key)
Index
entity
where key is key
from the index.
Implementations can choose to not implement this method and should
in that case throw UnsupportedOperationException
.
remove
in interface Index<T extends PropertyContainer>
entity
- the entity (Node
or Relationship
) to
remove the this index.public void remove(T entity)
Index
Index.add(PropertyContainer, String, Object)
.
Implementations can choose to not implement this method and should
in that case throw UnsupportedOperationException
.
remove
in interface Index<T extends PropertyContainer>
entity
- the entity (Node
or Relationship
) to
remove the this index.public void delete()
Index
delete
in interface Index<T extends PropertyContainer>
public IndexHits<T> get(String key, Object value)
ReadableIndex
#add(PropertyContainer, String, Object)
method.
get
in interface ReadableIndex<T extends PropertyContainer>
key
- the key in the key/value pair to match.value
- the value in the key/value pair to match.
IndexHits
object. If the entire
result set isn't looped through, IndexHits.close()
must be
called before disposing of the result.public IndexHits<T> query(String key, Object queryOrQueryObject)
ReadableIndex
key
and
query object, which can be a query string or an implementation-specific
query object.
query
in interface ReadableIndex<T extends PropertyContainer>
key
- the key in this query.queryOrQueryObject
- the query for the key
to match.
IndexHits
object. If the entire
result set isn't looped through, IndexHits.close()
must be
called before disposing of the result.public IndexHits<T> query(Object queryOrQueryObject)
ReadableIndex
query
in interface ReadableIndex<T extends PropertyContainer>
queryOrQueryObject
- the query to match.
IndexHits
object. If the entire
result set isn't looped through, IndexHits.close()
must be
called before disposing of the result.public boolean isWriteable()
ReadableIndex
isWriteable
in interface ReadableIndex<T extends PropertyContainer>
public T putIfAbsent(T entity, String key, Object value)
Index
putIfAbsent
in interface Index<T extends PropertyContainer>
entity
- the entity (i.e Node
or Relationship
)
to associate the key/value pair with.key
- the key in the key/value pair to associate with the entity.value
- the value in the key/value pair to associate with the
entity.
null
if no entity was
indexed before (and the specified entity was added to the index).
|
Neo4j Community | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |