From 3da0557aa01653b53870a119c138eeef4f18021b Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 17 Mar 2012 10:37:22 -0400 Subject: [PATCH] [Bleeding] Add iterator() with starting index. Addresses BUKKIT-1246 --- src/main/java/org/bukkit/inventory/Inventory.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java index c5dc995c..6016b1f6 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java @@ -272,4 +272,13 @@ public interface Inventory extends Iterable { public InventoryHolder getHolder(); public ListIterator iterator(); + + /** + * Returns an iterator starting at the given index. If the index is positive, then the first + * call to next() will return the item at that index; if it is negative, the first call to + * previous will return the item at index (getSize() + index). + * @param index The index. + * @return An iterator. + */ + public ListIterator iterator(int index); }