|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.gl.batch.service.impl.OriginEntryFileIterator
public class OriginEntryFileIterator
This class lazy loads the origin entries in a flat file. This implementation uses a limited amount of memory because it does not pre-load all of the origin entries at once. (Assuming that the Java garbage collector is working well). However, if the code that uses this iterator stores the contents of this iterator in a big list somewhere, then a lot of memory may be consumed, depending on the size of the file.
Field Summary | |
---|---|
protected boolean |
autoCloseReader
|
protected int |
lineNumber
|
protected OriginEntryFull |
nextEntry
|
protected BufferedReader |
reader
|
Constructor Summary | |
---|---|
OriginEntryFileIterator(BufferedReader reader)
Constructs a OriginEntryFileIterator |
|
OriginEntryFileIterator(BufferedReader reader,
boolean autoCloseReader)
Constructs a OriginEntryFileIterator |
|
OriginEntryFileIterator(File file)
Constructs a OriginEntryFileIterator When constructed with this method, the file handle will be automatically closed when the end of origin entries has been reached (i.e. |
Method Summary | |
---|---|
protected void |
fetchNextEntry()
This method returns the next line in origin entry file |
protected void |
finalize()
|
boolean |
hasNext()
|
OriginEntryFull |
next()
|
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected OriginEntryFull nextEntry
protected BufferedReader reader
protected int lineNumber
protected boolean autoCloseReader
Constructor Detail |
---|
public OriginEntryFileIterator(BufferedReader reader)
reader
- a reader representing flat-file origin entriesautoCloseReader
- whether to automatically close the reader when the end of origin entries has been reached (i.e. when
hasNext() returns false)public OriginEntryFileIterator(BufferedReader reader, boolean autoCloseReader)
reader
- a reader representing flat-file origin entriesautoCloseReader
- whether to automatically close the reader when the end of origin entries has been reached (i.e. when
hasNext() returns false)public OriginEntryFileIterator(File file)
file
- the fileMethod Detail |
---|
public boolean hasNext()
hasNext
in interface Iterator<OriginEntryFull>
Iterator.hasNext()
public OriginEntryFull next()
next
in interface Iterator<OriginEntryFull>
Iterator.next()
public void remove()
remove
in interface Iterator<OriginEntryFull>
Iterator.remove()
protected void fetchNextEntry()
protected void finalize() throws Throwable
finalize
in class Object
Throwable
Object.finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |