Package com.iizix.prop.content
Interface IContentProviderPropCnrAPI<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>>
- All Known Implementing Classes:
EMapMarkers
,EMLGroup
,MapMarkers
,MLGroup
public interface IContentProviderPropCnrAPI<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>>
The API as an interface with default code that easily is added to a container to provide the general code.- Author:
- Christopher Mindus
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
add(int index, ITEM_CONTENT item)
Inserts a new item before the specified index.default void
add(ITEM_CONTENT item)
Adds a new item last.default ITEM_CONTENT
get(int index)
Gets an item at the specified index.default ITEM_CONTENT[]
getAll()
Gets all items.IContentProviderAPI<ITEM,ITEM_CONTENT>
getAPIContentProvider()
Gets the content provider for the API.default int
indexOf(ITEM_CONTENT item)
Returns the index of an item.default ITEM_CONTENT
remove(int index)
Removes an item at the specified index.default boolean
remove(ITEM_CONTENT item)
Removes an item.default boolean
removeAll()
Removes all items.
Method Detail
add
default void add(ITEM_CONTENT item)
Adds a new item last.- Parameters:
item
- The item to insert.- Throws:
java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
add
default void add(int index, ITEM_CONTENT item)
Inserts a new item before the specified index.- Parameters:
index
- The insertion point index, -1 for last.item
- The item to insert.- Throws:
java.lang.IndexOutOfBoundsException
- If the index is not valid.java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
remove
default ITEM_CONTENT remove(int index)
Removes an item at the specified index.- Parameters:
index
- The item to remove.- Returns:
- The removed item.
- Throws:
java.lang.IndexOutOfBoundsException
- If the index is not valid.java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
remove
default boolean remove(ITEM_CONTENT item)
Removes an item.- Parameters:
item
- The item to remove.- Returns:
- true for success, false if not found.
- Throws:
java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
removeAll
default boolean removeAll()
Removes all items.- Returns:
- true for changed, false when no items were present.
- Throws:
java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
get
default ITEM_CONTENT get(int index)
Gets an item at the specified index.- Parameters:
index
- The index of the item.- Returns:
- The item.
- Throws:
java.lang.IndexOutOfBoundsException
- If the index is not valid.java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
getAll
default ITEM_CONTENT[] getAll()
Gets all items.- Returns:
- The array of items.
- Throws:
java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
indexOf
default int indexOf(ITEM_CONTENT item)
Returns the index of an item.- Parameters:
item
- The item to look-up.- Returns:
- The index of the item, or -1 if not found.
- Throws:
java.lang.IllegalStateException
- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
getAPIContentProvider
IContentProviderAPI<ITEM,ITEM_CONTENT> getAPIContentProvider()
Gets the content provider for the API.- Returns:
- The content provider, or null if API is not supported or none is set.