|
Neo4j | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of items in the Iterator.public interface IndexHits<T>
An Iterator
with additional size()
and close()
methods on it, used for iterating over index query results. It is first and
foremost an Iterator
, but also an Iterable
JUST so that it
can be used in a for-each loop. The iterator()
method
always returns this
.
The size is calculated before-hand so that calling it is always fast.
When you're done with the result and haven't reached the end of the
iteration close()
must be called. Results which are looped through
entirely closes automatically. Typical use:
IndexHitshits = index.get( "key", "value" ); try { for ( Node node : hits ) { // do something with the hit } } finally { hits.close(); }
Method Summary | |
---|---|
void |
close()
Closes the underlying search result. |
float |
currentScore()
Returns the score of the most recently fetched item from this iterator (from Iterator.next() ). |
T |
getSingle()
Returns the first and only item from the result iterator, or null
if there was none. |
int |
size()
Returns the size of this iterable, in most scenarios this value is accurate while in some scenarios near-accurate. |
Methods inherited from interface java.util.Iterator |
---|
hasNext, next, remove |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
int size()
IndexHits
object has been returned when inside a Transaction
which has index modifications, of a certain nature. Also entities
(Node
s/Relationship
s) which have been deleted from the graph,
but are still in the index will also affect the accuracy of the returned size.
void close()
T getSingle()
null
if there was none. If there were more than one item in the result a
NoSuchElementException
will be thrown. This method must be called
first in the iteration and will grab the first item from the iteration,
so the result is considered broken after this call.
null
if none.float currentScore()
Iterator.next()
). The range of the returned values is up to the
Index
implementation to dictate.
|
Neo4j | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |