Class EntitySetImpl

java.lang.Object
de.fraunhofer.iosb.ilt.frostclient.model.EntitySetImpl
All Implemented Interfaces:
EntitySet, Iterable<Entity>

public class EntitySetImpl extends Object implements EntitySet
Implementation of EntitySet interface.
  • Field Details

    • data

      protected List<Entity> data
    • count

      protected long count
  • Constructor Details

  • Method Details

    • toList

      public List<Entity> toList()
      Description copied from interface: EntitySet
      Get the currently loaded entities as a List<Entity>. This returns the internal ArrayList.
      Specified by:
      toList in interface EntitySet
      Returns:
      the list of currently loaded entities.
    • size

      public int size()
      Description copied from interface: EntitySet
      Get the number of currently loaded Entities in the Set.
      Specified by:
      size in interface EntitySet
      Returns:
      The number of currently loaded Entities in the Set.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: EntitySet
      Check if there are entities currently loaded in the set.
      Specified by:
      isEmpty in interface EntitySet
      Returns:
      true if there are no Entities currently loaded in the set.
    • iterator

      public Iterator<Entity> iterator()
      Description copied from interface: EntitySet
      Get an iterator that iterates over all entities, following nextLinks if needed.
      Specified by:
      iterator in interface EntitySet
      Specified by:
      iterator in interface Iterable<Entity>
      Returns:
      An iterator that iterates over all entities, following nextLinks if needed.
    • fetchNext

      public void fetchNext()
      Description copied from interface: EntitySet
      Use the nextLink to fetch more Entities.
      Specified by:
      fetchNext in interface EntitySet
    • add

      public void add(Entity e)
      Specified by:
      add in interface EntitySet
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getCount

      public long getCount()
      Description copied from interface: EntitySet
      Get The total number of entities in the Set that exist on the server. Returns -1 if the count is not loaded.
      Specified by:
      getCount in interface EntitySet
      Returns:
      The total number of entities in the Set that exist on the server.
    • setCount

      public void setCount(long count)
      Specified by:
      setCount in interface EntitySet
    • hasNextLink

      public boolean hasNextLink()
      Description copied from interface: EntitySet
      Check if there is a nextLink.
      Specified by:
      hasNextLink in interface EntitySet
      Returns:
      true if there is a nextLink to fetch more Entities.
    • getNextLink

      public String getNextLink()
      Description copied from interface: EntitySet
      Get the nextLink, if it exists. NULL otherwise.
      Specified by:
      getNextLink in interface EntitySet
      Returns:
      the nextLink, if it exists.
    • setNextLink

      public void setNextLink(String nextLink)
      Specified by:
      setNextLink in interface EntitySet
    • getEntityType

      public EntityType getEntityType()
      Specified by:
      getEntityType in interface EntitySet
    • getNavigationProperty

      public NavigationPropertyEntitySet getNavigationProperty()
      Description copied from interface: EntitySet
      Get the navigationProperty that manages this EntitySet. Can be null, for top-level entity sets.
      Specified by:
      getNavigationProperty in interface EntitySet
      Returns:
      the navigationProperty that manages this EntitySet.
    • setNavigationProperty

      public EntitySetImpl setNavigationProperty(NavigationPropertyEntitySet navigationProperty)
    • setService

      public void setService(SensorThingsService service)
      Description copied from interface: EntitySet
      Sets the service for the set and all Entities in the set.
      Specified by:
      setService in interface EntitySet
      Parameters:
      service - the service to set.