Class MetisListIndexed<T extends MetisDataItem.MetisDataIndexedItem>
java.lang.Object
io.github.tonywasher.joceanus.metis.list.MetisListIndexed<T>
- Type Parameters:
T- the item type
- All Implemented Interfaces:
MetisDataItem.MetisDataList<T>,MetisDataItem.MetisDataObjectFormat,MetisFieldItem
- Direct Known Subclasses:
MetisListVersioned
public class MetisListIndexed<T extends MetisDataItem.MetisDataIndexedItem>
extends Object
implements MetisDataItem.MetisDataList<T>, MetisFieldItem
Indexed List.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.tonywasher.joceanus.metis.field.MetisFieldItem
MetisFieldItem.MetisFieldDef, MetisFieldItem.MetisFieldItemType, MetisFieldItem.MetisFieldSetDef, MetisFieldItem.MetisFieldTableItem, MetisFieldItem.MetisFieldUpdatableItem, MetisFieldItem.MetisFieldVersionedDef -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the item at index.booleanAdd the item.Allocate the next Id.protected voidCheck the Id.voidclear()Clear the list.booleancontainsId(Integer pId) Is ID present in list?booleancontainsItem(T pItem) Determine whether an item is in the list.Copy the idMap.booleanformatObject(OceanusDataFormatter pFormatter) Obtain Object summary.getAtIndex(int pIndex) Obtain the item at the index.Obtain the comparator.Obtain the fieldSet.getIdMap()Obtain the idMap.getItemById(Integer pId) Obtain item by Id.Obtain the next Id.Obtain underlying list.inthashCode()intindexOfItem(T pItem) Obtain the index of the item.voidinsertAtIndex(T pItem, int pIndex) Insert the item at the index.iterator()Obtain the list iterator.Obtain a list iterator.listIterator(int pIndex) Obtain the list iterator.booleanRemove the item.removeAtIndex(int pIndex) Remove the item at the index.voidremoveById(Integer pId) Remove item from the list.voidremoveFromList(T pItem) Remove item from the list.Obtain a reverse list iterator.voidsetComparator(Comparator<T> pComparator) Set the comparator.voidsortList()Sort the list.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.tonywasher.joceanus.metis.data.MetisDataItem.MetisDataList
isEmpty, size
-
Constructor Details
-
MetisListIndexed
public MetisListIndexed()Constructor.
-
-
Method Details
-
getDataFieldSet
Description copied from interface:MetisFieldItemObtain the fieldSet.- Specified by:
getDataFieldSetin interfaceMetisFieldItem- Returns:
- the fieldSet
-
formatObject
Description copied from interface:MetisDataItem.MetisDataObjectFormatObtain Object summary.- Specified by:
formatObjectin interfaceMetisDataItem.MetisDataObjectFormat- Parameters:
pFormatter- the data formatter- Returns:
- the display summary of the object
-
toString
-
getIdMap
Obtain the idMap.- Returns:
- the map
-
copyIdMap
Copy the idMap.- Returns:
- the copy of the map
-
getUnderlyingList
Description copied from interface:MetisDataItem.MetisDataListObtain underlying list.- Specified by:
getUnderlyingListin interfaceMetisDataItem.MetisDataList<T extends MetisDataItem.MetisDataIndexedItem>- Returns:
- the list
-
setComparator
Set the comparator.- Parameters:
pComparator- the comparator
-
getComparator
Obtain the comparator.- Returns:
- the comparator
-
getNextId
Obtain the next Id.- Returns:
- the next Id
-
allocateNextId
Allocate the next Id.- Returns:
- the next allocated Id
-
add
Description copied from interface:MetisDataItem.MetisDataListAdd the item.- Specified by:
addin interfaceMetisDataItem.MetisDataList<T extends MetisDataItem.MetisDataIndexedItem>- Parameters:
pItem- the item- Returns:
- true/false - was item added?
-
add
Description copied from interface:MetisDataItem.MetisDataListAdd the item at index.- Specified by:
addin interfaceMetisDataItem.MetisDataList<T extends MetisDataItem.MetisDataIndexedItem>- Parameters:
pIndex- the indexpItem- the item
-
removeFromList
Remove item from the list.- Parameters:
pItem- the item to remove
-
removeById
Remove item from the list.- Parameters:
pId- the id of the item to remove
-
remove
Description copied from interface:MetisDataItem.MetisDataListRemove the item.- Specified by:
removein interfaceMetisDataItem.MetisDataList<T extends MetisDataItem.MetisDataIndexedItem>- Parameters:
pItem- the item- Returns:
- true/false - was item in list?
-
getItemById
Obtain item by Id.- Parameters:
pId- the id- Returns:
- the item or null
-
containsItem
Determine whether an item is in the list.- Parameters:
pItem- the item- Returns:
- true/false
-
containsId
Is ID present in list?- Parameters:
pId- the id to lookup- Returns:
- true/false
-
clear
public void clear()Description copied from interface:MetisDataItem.MetisDataListClear the list.- Specified by:
clearin interfaceMetisDataItem.MetisDataList<T extends MetisDataItem.MetisDataIndexedItem>
-
indexOfItem
Obtain the index of the item.- Parameters:
pItem- the item- Returns:
- the index or -1 if not present
-
getAtIndex
Obtain the item at the index.- Parameters:
pIndex- the index of the item- Returns:
- the item
-
removeAtIndex
Remove the item at the index.- Parameters:
pIndex- the index of the item- Returns:
- the item that was removed
-
insertAtIndex
Insert the item at the index.- Parameters:
pItem- the item to insertpIndex- the index to insert at
-
iterator
Description copied from interface:MetisDataItem.MetisDataListObtain the list iterator.- Specified by:
iteratorin interfaceMetisDataItem.MetisDataList<T extends MetisDataItem.MetisDataIndexedItem>- Returns:
- the iterator
-
listIterator
Obtain a list iterator.- Returns:
- the iterator
-
reverseIterator
Obtain a reverse list iterator.- Returns:
- the iterator
-
listIterator
Description copied from interface:MetisDataItem.MetisDataListObtain the list iterator.- Specified by:
listIteratorin interfaceMetisDataItem.MetisDataList<T extends MetisDataItem.MetisDataIndexedItem>- Parameters:
pIndex- the list position- Returns:
- the iterator
-
sortList
public void sortList()Sort the list. -
checkId
Check the Id.- Parameters:
pId- the id
-
equals
-
hashCode
public int hashCode()
-