net.sf.beanlib.util
Class TextIterable

java.lang.Object
  extended by net.sf.beanlib.util.TextIterable
All Implemented Interfaces:
Closeable, Iterable<String>

@ThreadSafe
public class TextIterable
extends Object
implements Iterable<String>, Closeable

Author:
Hanson Char

Field Summary
private  Charset charset
           
private  CharsetDecoder charsetDecoder
           
private  String charsetname
           
private  List<LineIterator> openedIterators
           
private  boolean returnNullUponEof
           
private  URL url
           
 
Constructor Summary
TextIterable(File file)
           
TextIterable(String resourcePath)
           
TextIterable(URL url)
           
 
Method Summary
 void close()
           
 Charset getCharset()
           
 CharsetDecoder getCharsetDecoder()
           
 String getCharsetname()
           
 boolean isReturnNullUponEof()
           
 LineIterator iterator()
           
 int numberOfopenedIterators()
           
(package private)  void removeLineIterator(LineIterator li)
           
 void setCharset(Charset charset)
           
 void setCharsetDecoder(CharsetDecoder charsetDecoder)
           
 void setCharsetname(String charsetname)
           
 void setReturnNullUponEof(boolean returnNullUponEof)
           
 TextIterable withCharset(Charset charset)
           
 TextIterable withCharsetDecoder(CharsetDecoder charsetDecoder)
           
 TextIterable withCharsetname(String charsetname)
           
 TextIterable withReturnNullUponEof(boolean returnNullUponEof)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

private final URL url

openedIterators

private final List<LineIterator> openedIterators

returnNullUponEof

private volatile boolean returnNullUponEof

charsetname

private String charsetname

charset

private Charset charset

charsetDecoder

private CharsetDecoder charsetDecoder
Constructor Detail

TextIterable

public TextIterable(File file)
             throws MalformedURLException
Throws:
MalformedURLException

TextIterable

public TextIterable(URL url)

TextIterable

public TextIterable(String resourcePath)
Method Detail

iterator

public LineIterator iterator()
Specified by:
iterator in interface Iterable<String>

close

public void close()
Specified by:
close in interface Closeable

numberOfopenedIterators

public int numberOfopenedIterators()

removeLineIterator

void removeLineIterator(LineIterator li)

isReturnNullUponEof

public boolean isReturnNullUponEof()

setReturnNullUponEof

public void setReturnNullUponEof(boolean returnNullUponEof)

withReturnNullUponEof

public TextIterable withReturnNullUponEof(boolean returnNullUponEof)

getCharset

public Charset getCharset()

setCharset

public void setCharset(Charset charset)

withCharset

public TextIterable withCharset(Charset charset)

getCharsetDecoder

public CharsetDecoder getCharsetDecoder()

setCharsetDecoder

public void setCharsetDecoder(CharsetDecoder charsetDecoder)

withCharsetDecoder

public TextIterable withCharsetDecoder(CharsetDecoder charsetDecoder)

getCharsetname

public String getCharsetname()

setCharsetname

public void setCharsetname(String charsetname)

withCharsetname

public TextIterable withCharsetname(String charsetname)