Interface ICodeItemArrayContainer
- All Superinterfaces:
IKStringArrayContainer,IStringArrayContainer
- All Known Implementing Classes:
CodeItemArrayProp,EUIComboBox,EUISpinner,UIAbstractListChoice,UIComboBox,UISpinner
public interface ICodeItemArrayContainer extends IStringArrayContainer, IKStringArrayContainer
Interface implements by containers that can contain String elements of some kind.- Author:
- Christopher Mindus
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidaddItem(ICodeItem item)Adds a new item.default voidaddItem(KString item)Adds a new item.default voidaddItem(java.lang.String item)Adds a new item.default voidaddItems(ICodeItem... items)Adds a new items.default voidaddItems(java.util.Collection<ICodeItem> items)Adds a new items.default ICodeItemArrayContainergetCodeArrayArrayContainer()Gets the target implementor of the interface.default ICodeItemgetItem(int index)Gets the item at the specified index as a KString.default intgetItemCount()Gets the item count.default intgetItemIndex(ICodeItem item)Gets the index of of item.default KStringgetItemKString(int index)Gets the item at the specified index as a KString.default ICodeItem[]getItems()Gets the array of items.default java.lang.StringgetItemString(int index)Gets the item at the specified index as a String.default voidinsertItem(ICodeItem item, int index)Inserts an item at specified index.default voidinsertItem(KString item, int index)Inserts an item at specified index.default voidinsertItem(java.lang.String item, int index)Inserts an item at specified index.default voidremoveAllItems()Removes all items.default voidremoveAllItems(boolean keepSelection)Removes all items but keeps the selection depending on the flag.default ICodeItemremoveItem(int index)Removes an item.default intremoveItem(ICodeItem item)Removes an item.default ICodeItemsetItem(ICodeItem item, int index)Sets an item at specified index.default KStringsetItem(KString item, int index)Sets an item at specified index.default java.lang.StringsetItem(java.lang.String item, int index)Sets an item at specified index.default voidsortItems()Sorts the list according to the default JVM locale case sensitively.default voidsortItems(boolean isCaseInsensitive)Sorts the list according to the default JVM locale.default voidsortItems(java.util.Locale locale)Sorts the list according to a locale case sensitively.default voidsortItems(java.util.Locale locale, boolean isCaseInsensitive)Sorts the list according to a locale.Methods inherited from interface com.iizix.prop.IKStringArrayContainer
addItems, getItemsAsKStrings, getKStringArrayContainer, isHTMLKStringSupported, removeItem
Methods inherited from interface com.iizix.prop.IStringArrayContainer
addItems, getItemsAsStrings, getStringArrayContainer, removeItem
Method Detail
getCodeArrayArrayContainer
default ICodeItemArrayContainer getCodeArrayArrayContainer()
Gets the target implementor of the interface.- Returns:
- The target implements of the interface, null for none (this instance).
getItems
default ICodeItem[] getItems()
Gets the array of items.- Returns:
- An array of code items.
getItem
default ICodeItem getItem(int index)
Gets the item at the specified index as a KString.- Parameters:
index- The index.- Returns:
- The KString item.
- Throws:
java.lang.IndexOutOfBoundsException- If the index is invalid.
getItemIndex
default int getItemIndex(ICodeItem item)
Gets the index of of item.- Parameters:
item- The item.- Returns:
- The index of the item, or -1 if not found or item is null.
getItemString
default java.lang.String getItemString(int index)
Gets the item at the specified index as a String.- Specified by:
getItemStringin interfaceIStringArrayContainer- Parameters:
index- The index.- Returns:
- The String item.
- Throws:
java.lang.IndexOutOfBoundsException- If the index is invalid.
getItemKString
default KString getItemKString(int index)
Gets the item at the specified index as a KString.- Specified by:
getItemKStringin interfaceIKStringArrayContainer- Parameters:
index- The index.- Returns:
- The KString item.
- Throws:
java.lang.IndexOutOfBoundsException- If the index is invalid.
getItemCount
default int getItemCount()
Gets the item count.- Specified by:
getItemCountin interfaceIKStringArrayContainer- Specified by:
getItemCountin interfaceIStringArrayContainer- Returns:
- The count of items.
sortItems
default void sortItems()
Sorts the list according to the default JVM locale case sensitively.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItemsin interfaceIKStringArrayContainer- Specified by:
sortItemsin interfaceIStringArrayContainer- Throws:
java.lang.IllegalStateException- If the container is read-only.
sortItems
default void sortItems(boolean isCaseInsensitive)
Sorts the list according to the default JVM locale.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItemsin interfaceIKStringArrayContainer- Specified by:
sortItemsin interfaceIStringArrayContainer- Parameters:
isCaseInsensitive- Flag for case insensitive.- Throws:
java.lang.IllegalStateException- If the container is read-only.
sortItems
default void sortItems(java.util.Locale locale)
Sorts the list according to a locale case sensitively.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItemsin interfaceIKStringArrayContainer- Specified by:
sortItemsin interfaceIStringArrayContainer- Parameters:
locale- The locale to use for string sorting.- Throws:
java.lang.IllegalStateException- If the container is read-only.
sortItems
default void sortItems(java.util.Locale locale, boolean isCaseInsensitive)Sorts the list according to a locale.The selected index may change as a result of the sorting if selection is supported.
- Specified by:
sortItemsin interfaceIKStringArrayContainer- Specified by:
sortItemsin interfaceIStringArrayContainer- Parameters:
locale- The locale to use for string sorting, null for default..isCaseInsensitive- Flag for case insensitive.- Throws:
java.lang.IllegalStateException- If the container is read-only.
addItem
default void addItem(ICodeItem item)
Adds a new item.- Parameters:
item- The item to add.- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IllegalStateException- If the container is read-only.
addItem
default void addItem(java.lang.String item)
Adds a new item.- Specified by:
addItemin interfaceIStringArrayContainer- Parameters:
item- The item to add.- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IllegalStateException- If the container is read-only.
addItem
default void addItem(KString item)
Adds a new item.- Specified by:
addItemin interfaceIKStringArrayContainer- Parameters:
item- The item to add.- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IllegalStateException- If the container is read-only.
addItems
default void addItems(ICodeItem... items)
Adds a new items.- Parameters:
items- The items to add.- Throws:
java.lang.NullPointerException- If an item is null.java.lang.IllegalStateException- If the container is read-only.
addItems
default void addItems(java.util.Collection<ICodeItem> items)
Adds a new items.- Parameters:
items- The items to add.- Throws:
java.lang.NullPointerException- If an item is null.java.lang.IllegalStateException- If the container is read-only.
insertItem
default void insertItem(ICodeItem item, int index)
Inserts an item at specified index.The selection may be changed due to this operation if the owner support selection.
- Parameters:
item- The item to add.index- The index to insert the item before (-1 for last).- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
insertItem
default void insertItem(java.lang.String item, int index)Inserts an item at specified index.The selection may be changed due to this operation if the owner support selection.
- Specified by:
insertItemin interfaceIStringArrayContainer- Parameters:
item- The item to add.index- The index to insert the item before (-1 for last).- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
insertItem
default void insertItem(KString item, int index)
Inserts an item at specified index.The selection may be changed due to this operation if the owner support selection.
- Specified by:
insertItemin interfaceIKStringArrayContainer- Parameters:
item- The item to add.index- The index to insert the item before (-1 for last).- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
setItem
default ICodeItem setItem(ICodeItem item, int index)
Sets an item at specified index.- Parameters:
item- The item to set.index- The index of the item.- Returns:
- The old item.
- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
setItem
default java.lang.String setItem(java.lang.String item, int index)Sets an item at specified index.- Specified by:
setItemin interfaceIStringArrayContainer- Parameters:
item- The item to set.index- The index of the item.- Returns:
- The old item.
- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
setItem
default KString setItem(KString item, int index)
Sets an item at specified index.- Specified by:
setItemin interfaceIKStringArrayContainer- Parameters:
item- The item to set.index- The index of the item.- Returns:
- The old item.
- Throws:
java.lang.NullPointerException- If the item is null.java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
removeItem
default ICodeItem removeItem(int index)
Removes an item.The selection may be changed due to this operation if the owner support selection.
- Specified by:
removeItemin interfaceIKStringArrayContainer- Specified by:
removeItemin interfaceIStringArrayContainer- Parameters:
index- The index of the item to delete.- Returns:
- The item deleted.
- Throws:
java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
removeItem
default int removeItem(ICodeItem item)
Removes an item.The selection may be changed due to this operation if the owner support selection.
- Parameters:
item- The item to remove.- Returns:
- The index of the item removed, -1 if not found.
- Throws:
java.lang.IndexOutOfBoundsException- If the index is in error.java.lang.IllegalStateException- If the container is read-only.
removeAllItems
default void removeAllItems()
Removes all items.The selection may be changed (cleared) due to this operation if the owner support selection.
- Specified by:
removeAllItemsin interfaceIKStringArrayContainer- Specified by:
removeAllItemsin interfaceIStringArrayContainer- Throws:
java.lang.IllegalStateException- If the container is read-only.
removeAllItems
default void removeAllItems(boolean keepSelection)
Removes all items but keeps the selection depending on the flag.The selection may be changed (cleared) due to this operation if the owner support selection.
- Specified by:
removeAllItemsin interfaceIKStringArrayContainer- Specified by:
removeAllItemsin interfaceIStringArrayContainer- Parameters:
keepSelection- The boolean to keep the selection.- Throws:
java.lang.IllegalStateException- If the container is read-only.