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 Details

    • add

      default void add(ITEM_CONTENT item)
      Adds a new item last.
      Parameters:
      item - The item to insert.
      Throws:
      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:
      IndexOutOfBoundsException - If the index is not valid.
      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:
      IndexOutOfBoundsException - If the index is not valid.
      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:
      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:
      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:
      IndexOutOfBoundsException - If the index is not valid.
      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:
      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:
      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.