|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.sorting.sorter.SortedDataFile
public class SortedDataFile
SortedDataFile
encapsulates the functionality that is needed for the TwoPhaseMultiWayMergeSorter
in phase two. It provides a
method for removing the file and methods for iterating over the content of the file.
Constructor Summary | |
---|---|
SortedDataFile(FileBasedStorage<DuDeObject> file)
Initializes a SortedDataFile and loads the first element. |
Method Summary | |
---|---|
void |
close()
|
DuDeObject |
current()
Returns the element on which the iterating pointer points right now. |
void |
deleteFile()
Deletes the file from the file system and clears the member data of this instance. |
FileBasedStorage<DuDeObject> |
getDataFile()
Returns the FileBasedStorage that is encapsulated in this instance. |
boolean |
hasNext()
Checks whether the end of the file is reached. |
protected boolean |
isAccessible()
Checks whether the file can be accessed. |
DuDeObject |
next()
Sets the the iteration pointer to the next element and returns it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SortedDataFile(FileBasedStorage<DuDeObject> file)
SortedDataFile
and loads the first element. Therefore calling next()
after calling this constructor returns
the second element.
file
- The FileBasedStorage
that is read.Method Detail |
---|
public DuDeObject current()
null
, if the end of the file is reached.public void deleteFile()
public boolean hasNext()
true
, if this file has still data to read; otherwise false
.public DuDeObject next()
DuDeObject
instance in this collection or null
, if the end of the file is reached.protected boolean isAccessible()
true
, if the file can be accessed; otherwise false
.public FileBasedStorage<DuDeObject> getDataFile()
FileBasedStorage
that is encapsulated in this instance.
FileBasedStorage
.public void close() throws IOException
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |