|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectintroExam.LinkedList.LL
ExtendedLL
These methods are the candidates for the linked list question
Nested Class Summary |
Nested classes inherited from class introExam.LinkedList.LL |
LL.LLNode |
Field Summary |
Fields inherited from class introExam.LinkedList.LL |
head |
Constructor Summary | |
ExtendedLL()
|
Method Summary | |
ExtendedLL |
getItemsNotPresent(ExtendedLL otherList)
Creates and returns a new list, which contains exactly those items that are not present in this list, but that are present in the otherList. |
ExtendedLL |
intersection(ExtendedLL otherList)
Creates and returns a new list, which contains exactly those items that are present in both lists |
boolean |
isSubset(ExtendedLL otherList)
This method returns true if and only if the otherList is a subset of this list and false otherwise. |
void |
removeAllGreaterItems(java.lang.Comparable keyItem)
Removes each and every item greater than the keyItem from the list. |
void |
removeAllMatchingItems(java.lang.Comparable keyItem)
Removes each and every item equal to the keyItem from the list. |
void |
removeEvenItems()
This removes items with even indexes from the list. |
void |
removeOddItems()
Removes items with odd indexes from the list. |
ExtendedLL |
reverse()
Creates and returns a new linked list referencing the same items as the original list, except organizing them in the opposite order. |
ExtendedLL |
xOr(ExtendedLL otherList)
Creates and returns a new list, which contains exactly those items that are present in exactly one of the two lists, but not both. |
Methods inherited from class introExam.LinkedList.LL |
addFirst, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExtendedLL()
Method Detail |
public void removeAllMatchingItems(java.lang.Comparable keyItem)
In the event of an error, it does not change the list, instead it returns leaving the list in its prior condition.
keyItem
- Each and every item within the list equal to this
item is removed from the list.public void removeAllGreaterItems(java.lang.Comparable keyItem)
In the event of an error, it does not change the list, instead it returns leaving the list in its prior condition.
keyItem
- Each and every item within the list greater than
this item is removed from the list.public void removeOddItems()
In the event of an error, it does not change the list, instead it returns leaving the list in its prior condition.
public void removeEvenItems()
In the event of an error, it does not change the list, instead it returns leaving the list in its prior condition.
public ExtendedLL getItemsNotPresent(ExtendedLL otherList)
This method does not change either of the original lists.
In the event of an error, it returns an empty list.
otherList
- is the list to be compared with this list
public ExtendedLL intersection(ExtendedLL otherList)
Each original list may have duplicate items, but the resulting list should have no more than one instance of each item
This method does not change either of the original lists
In the event of an error, it returns an empty list.
otherList
- is the list to be compared with this list
public ExtendedLL xOr(ExtendedLL otherList)
Each original list may have duplicate items, but the resulting list should have no more than one instance of each item
It does not change either of the original lists
In the event of an error, it returns an empty list.
otherList
- is the list that should be compared with this list
public boolean isSubset(ExtendedLL otherList)
The equality of items is evaluated by equals() or compareTo() on the item contained within the list.
This method is not sensitive to duplicate instances of an item in either list. For example, {a, a, b} is a subset of {a, b} and {a, b} is a subset of {a, a, b}
This method does not change either of the two lists.
In the event of an error, it returns false.
otherList
- is the list to be compared to this list
public ExtendedLL reverse()
In the event of an error, it returns null.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |