- Timestamp:
- 2003-05-27T15:40:47+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/util/EnumeratedVector.java
r4293 r4364 50 50 */ 51 51 public class EnumeratedVector 52 53 54 55 56 57 52 extends Vector 53 implements Enumeration { 54 /** The current index into our enumerated vector. */ 55 private int index = 0; 56 /** Can we call nextElement() without running out of entries in the vector. 57 * @return <i>true</i> if there are elements remaining, <i>false</i> otherwise. 58 58 */ 59 60 61 62 59 public boolean hasMoreElements() { 60 return (index < size()); 61 } 62 /** Retrieve the next element indicated by the current index. 63 63 * @return The next element as an <strong>Object</strong>. 64 64 */ 65 66 67 68 69 70 71 72 65 public Object nextElement() { 66 Object object = null; 67 if(index < size()) { 68 object = get(index); 69 index++; 70 } 71 return object; 72 } 73 73 }
Note:
See TracChangeset
for help on using the changeset viewer.