RegionIndex now extends Iterable<Region>.

This commit is contained in:
sk89q 2012-11-16 13:49:33 -08:00
parent 6fa7faad12
commit fe2e399451
3 changed files with 11 additions and 1 deletions

View File

@ -107,4 +107,9 @@ public synchronized int size() {
public void reindex() { public void reindex() {
// Whoo, nothing to do, because this index is so simple // Whoo, nothing to do, because this index is so simple
} }
@Override
public Iterator<Region> iterator() {
return regions.values().iterator();
}
} }

View File

@ -132,4 +132,9 @@ public void reindex() {
tree.load(regions.values()); tree.load(regions.values());
} }
@Override
public Iterator<Region> iterator() {
return regions.values().iterator();
}
} }

View File

@ -38,7 +38,7 @@
* querying by ID. Any casing can be used when looking up an ID. Implementations do NOT * querying by ID. Any casing can be used when looking up an ID. Implementations do NOT
* have to be thread-safe. * have to be thread-safe.
*/ */
public interface RegionIndex { public interface RegionIndex extends Iterable<Region> {
/** /**
* Queries the index for a list of {@link Region}s that contain the * Queries the index for a list of {@link Region}s that contain the