Interface LinkedListSet<I extends LinkedListSetEntry<I,O>,O>
-
- All Known Implementing Classes:
ComparatorLinkedListSet
,StrictLinkedListSet
public interface LinkedListSet<I extends LinkedListSetEntry<I,O>,O>
Linked List maintaining a unique set ofLinkedListSetEntry
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addEntry(I entry)
Adds aLinkedListSetEntry
to thisLinkedListSet
.LinkedListSetItem<I>
copyEntries()
Creates a copy of thisLinkedListSet
returning the head of the copy.I
getHead()
Obtains the head of thisLinkedListSet
.I
getTail()
Obtains the tail of thisLinkedListSet
.I
purgeEntries()
Purges allLinkedListSetEntry
instances within thisLinkedListSet
.boolean
removeEntry(I entry)
Removes thisLinkedListSetEntry
from theLinkedListSet
.
-
-
-
Method Detail
-
getHead
I getHead()
Obtains the head of thisLinkedListSet
.- Returns:
- Head
LinkedListSetEntry
of thisLinkedListSet
.
-
getTail
I getTail()
Obtains the tail of thisLinkedListSet
.- Returns:
- Tail of this
LinkedListSet
.
-
addEntry
void addEntry(I entry) throws java.lang.IllegalStateException
Adds aLinkedListSetEntry
to thisLinkedListSet
.- Parameters:
entry
-LinkedListSetEntry
to be added to thisLinkedListSet
.- Throws:
java.lang.IllegalStateException
- IfLinkedListSetEntry
is not valid for thisLinkedListSet
.
-
removeEntry
boolean removeEntry(I entry) throws java.lang.IllegalStateException
Removes thisLinkedListSetEntry
from theLinkedListSet
.- Parameters:
entry
-LinkedListSetEntry
to be removed from thisLinkedListSet
.- Returns:
true
if theLinkedListSetEntry
just removed was the lastLinkedListSetEntry
in theLinkedListSet
.- Throws:
java.lang.IllegalStateException
- IfLinkedListSetEntry
is not valid for thisLinkedListSet
.
-
purgeEntries
I purgeEntries()
Purges allLinkedListSetEntry
instances within thisLinkedListSet
.- Returns:
- Head of the
LinkedListSet
(before the purge) so that may action theLinkedListSetEntry
instances.
-
copyEntries
LinkedListSetItem<I> copyEntries()
Creates a copy of this
LinkedListSet
returning the head of the copy.The returned copy is
Thread
safe to iterate.- Returns:
- Head
LinkedListSetItem
of the copy.
-
-