|
||||||||||
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.AbstractDuDeObjectSorter
public abstract class AbstractDuDeObjectSorter
AbstractDuDeObjectSorter
implements the DuDeObjectSorter
interface partially. Sorting implementations only have to deal with
the abstract
method getSortedCollection()
.
Constructor Summary | |
---|---|
AbstractDuDeObjectSorter()
Initializes an AbstractDuDeObjectSorter with no SortingKey . |
|
AbstractDuDeObjectSorter(SortingKey key)
Initializes an AbstractDuDeObjectSorter with the passed SortingKey . |
Method Summary | |
---|---|
void |
add(DuDeObject record)
Adds a DuDeObject to the collection that will be sorted. |
void |
addAll(Iterable<DuDeObject> objects)
Adds all elements of the passed Iterable to the AbstractDuDeObjectSorter . |
void |
clear()
Clears the already added data. |
protected List<DuDeObject> |
getInMemoryData()
Returns the in-memory data. |
abstract DuDeStorage<DuDeObject> |
getSortedCollection()
Returns the sorted data. |
protected SortingKey |
getSortingKey()
Returns the SortingKey that defines the sorting order. |
protected boolean |
memoryLimitReached()
Checks whether the memory limit was reached. |
void |
setSortingKey(SortingKey sortingKey)
Sets a new SortingKey . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractDuDeObjectSorter()
AbstractDuDeObjectSorter
with no SortingKey
.
public AbstractDuDeObjectSorter(SortingKey key)
AbstractDuDeObjectSorter
with the passed SortingKey
.
key
- The key that defines the sorting order.Method Detail |
---|
public void add(DuDeObject record)
DuDeObjectSorter
DuDeObject
to the collection that will be sorted.
add
in interface DuDeObjectSorter
record
- The DuDeObject
.public void addAll(Iterable<DuDeObject> objects)
Iterable
to the AbstractDuDeObjectSorter
. It simply calls add(DuDeObject)
on each
element.
addAll
in interface DuDeObjectSorter
objects
- The DuDeObject
s that shall be added.public void clear()
DuDeObjectSorter
clear
in interface DuDeObjectSorter
public abstract DuDeStorage<DuDeObject> getSortedCollection() throws IOException
getSortedCollection
in interface DuDeObjectSorter
IOException
- If an error occurs while sorting the data file-based.protected boolean memoryLimitReached()
true
, if no more elements should be added; otherwise false
.protected List<DuDeObject> getInMemoryData()
protected SortingKey getSortingKey()
SortingKey
that defines the sorting order.
SortingKey
.public void setSortingKey(SortingKey sortingKey)
DuDeObjectSorter
SortingKey
.
setSortingKey
in interface DuDeObjectSorter
sortingKey
- The new SortingKey
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |