healpix.tools
Class StringIter

java.lang.Object
  extended byhealpix.tools.StringIter
All Implemented Interfaces:
java.util.Enumeration, java.util.Iterator

public class StringIter
extends java.lang.Object
implements java.util.Iterator, java.util.Enumeration

Wraps an iterator up and manufactures a string from each object returned. The String id compsed of the return values of the Get Methods provided in the COnstructor.


Field Summary
protected  java.util.Iterator dataIter
           
protected  java.lang.String delim
           
protected  java.lang.reflect.Method[] getms
           
protected  java.lang.String[] gets
           
 
Constructor Summary
StringIter(java.util.Enumeration e, java.lang.String[] gets)
           
StringIter(java.util.Iterator dataIter, java.lang.String[] gets)
          Need the list of gets and an iter Need classname to get the getMs
StringIter(java.util.Iterator dataIter, java.lang.String[] gets, java.lang.String d)
          Need the list of gets and an iter- also take delim
 
Method Summary
 boolean hasMoreElements()
          for enumeration
 boolean hasNext()
           
 void init(java.lang.Class cls)
           
 java.lang.Object next()
          Take next data object and create the String and return it
 java.lang.Object nextElement()
          for enumeration
 void remove()
          optional - needed to satisfy interface Iterator
 void setDelimiter(java.lang.String d)
          change delimeter between fields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataIter

protected java.util.Iterator dataIter

getms

protected java.lang.reflect.Method[] getms

gets

protected java.lang.String[] gets

delim

protected java.lang.String delim
Constructor Detail

StringIter

public StringIter(java.util.Iterator dataIter,
                  java.lang.String[] gets)
           throws java.lang.Exception
Need the list of gets and an iter Need classname to get the getMs


StringIter

public StringIter(java.util.Enumeration e,
                  java.lang.String[] gets)
           throws java.lang.Exception

StringIter

public StringIter(java.util.Iterator dataIter,
                  java.lang.String[] gets,
                  java.lang.String d)
           throws java.lang.Exception
Need the list of gets and an iter- also take delim

Method Detail

setDelimiter

public void setDelimiter(java.lang.String d)
change delimeter between fields


next

public java.lang.Object next()
Take next data object and create the String and return it

Specified by:
next in interface java.util.Iterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

remove

public void remove()
optional - needed to satisfy interface Iterator

Specified by:
remove in interface java.util.Iterator

nextElement

public java.lang.Object nextElement()
for enumeration

Specified by:
nextElement in interface java.util.Enumeration

hasMoreElements

public boolean hasMoreElements()
for enumeration

Specified by:
hasMoreElements in interface java.util.Enumeration

init

public void init(java.lang.Class cls)
          throws java.lang.Exception
Throws:
java.lang.Exception