Class SAODataListImpl<O>

java.lang.Object
de.linusdev.data.implemantations.SAODataListImpl<O>
All Implemented Interfaces:
AbstractData<String,O>, Datable, SAOData<O>, Iterable<Entry<String,O>>
Direct Known Subclasses:
SAOContentOnlyDataListImpl, SODataListImpl

public class SAODataListImpl<O> extends Object implements SAOData<O>
  • Field Details

  • Constructor Details

    • SAODataListImpl

      public SAODataListImpl(@NotNull @NotNull List<Entry<String,O>> list)
  • Method Details

    • add

      public boolean add(@NotNull @NotNull String key, O value)
      Adds a new entry, does NOT check if an entry with given key already exists!
      Specified by:
      add in interface AbstractData<String,O>
      Parameters:
      key - key
      value - value
      Returns:
      true if a new Entry was added, false otherwise
    • addEntry

      public void addEntry(@NotNull @NotNull Entry<String,O> entry)
      Description copied from interface: AbstractData
      Adds a new Entry.

      This method might not check, if a Entry with given key already exits (depending on the implementation)

      Specified by:
      addEntry in interface AbstractData<String,O>
      Parameters:
      entry - entry to add
    • getEntry

      public Entry<String,O> getEntry(@NotNull @NotNull String key)
      Specified by:
      getEntry in interface AbstractData<String,O>
      Parameters:
      key - key
      Returns:
      Entry with given key or null, if no such Entry exists.
    • remove

      public Entry<String,O> remove(@NotNull @NotNull String key)
      Description copied from interface: AbstractData

      Removes Entry with given key. If no such entry exists nothing happens.

      Specified by:
      remove in interface AbstractData<String,O>
      Parameters:
      key - key for the entry to remove
      Returns:
      the removed Entry or null if no entry was removed.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface AbstractData<String,O>
      Returns:
      true if this data does not contain any entries, false otherwise
    • size

      public int size()
      Specified by:
      size in interface AbstractData<String,O>
      Returns:
      current amount of entries contained.
    • iterator

      public Iterator<Entry<String,O>> iterator()
      Specified by:
      iterator in interface Iterable<O>