Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.neo4j.index
Interface IndexHits<T>

Type Parameters:
  `T` - the type of items in the Iterator.

All Superinterfaces:
  Iterable<T>, Iterator<T>

    public interface IndexHits<T>

extends Iterator<T>, Iterable<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's always fast. When you're done with your result and haven't reached the end of the iteration you must call `close()`. Results which are looped through entirely closes automatically.

Method Summary
`void` | `close()` Closes the underlying search result.
`int` | `size()` Returns the size of this iterable.

Methods inherited from interface java.util.Iterator
`hasNext, next, remove`

Methods inherited from interface java.lang.Iterable
`iterator`

Method Detail

### size

    int size()

  Returns the size of this iterable. The size is given at construction time so that the size is known before-hand so that it's basically just a simple return statement of an integer variable.

  Returns:
    the size if this iterable.

### close

    void close()

  Closes the underlying search result. This method should be called whenever you've got what you wanted from the result and won't use it anymore. It's necessary to call it so that underlying indexes can dispose of allocated resources for this search result. You can however skip to call this method if you loop through the whole result, then close() will be called automatically. Even if you loop through the entire result and then call this method it will silently ignore any consequtive call (for convenience).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 Neo4j. All Rights Reserved.