1 package com.thoughtworks.xstream.io; 2 3 import com.thoughtworks.xstream.io.HierarchicalStreamReader; 4 5 import java.util.Iterator ; 6 7 12 public class AttributeNameIterator implements Iterator { 13 14 private int current; 15 private final int count; 16 private final HierarchicalStreamReader reader; 17 18 public AttributeNameIterator(HierarchicalStreamReader reader) { 19 this.reader = reader; 20 count = reader.getAttributeCount(); 21 } 22 23 public boolean hasNext() { 24 return current < count; 25 } 26 27 public Object next() { 28 return reader.getAttributeName(current++); 29 } 30 31 public void remove() { 32 throw new UnsupportedOperationException (); 33 } 34 35 } 36 | Popular Tags |