Interface RemoteCollection<E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      IterableRemoteCollection<E> asIterable()
      Provides an Iterable view of this RemoteIterable.
      void clear()
      Remove all elements from this collection.
      boolean contains​(E o)
      Returns truee if this collection contains the specified element.
      boolean containsAll​(java.util.Collection<? extends E> c)
      Returns true if this collection contains all the elements in the given collection.
      void delete​(E element)
      Delete an element from the list.
      boolean deleteAll​(java.util.Collection<?> c)
      Removes all of this collection's elements that are contained in the given collection.
      java.util.Collection<E> getItems()
      Returns all items of this RemoteCollection.
      boolean isEmpty()
      Returns true if this collection contains no elements.
      boolean retainAll​(java.util.Collection<?> c)
      Removes all of this collection's elements that are not contained in the specified collection.
      int size()
      Returns the number of elements in this collection.
    • Method Detail

      • getItems

        java.util.Collection<E> getItems()
                                  throws java.rmi.RemoteException
        Returns all items of this RemoteCollection. Any change to the returned Collection is local and will not be sent to TPT.
        If you just want to iterate over the items use asIterable().
        Returns:
        all items of this RemoteCollection at once.
        Throws:
        java.rmi.RemoteException - remote communication problem
        See Also:
        asIterable()
      • delete

        void delete​(E element)
             throws java.rmi.RemoteException
        Delete an element from the list. This function directly deletes the corresponding element in TPT.

        If multiple RemoteCollections refer to the same collection in TPT, the TPT object will be deleted from the collection as soon as this method is called with any of those and the change is reflected in all of them.

        Parameters:
        element - The element to remove.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • size

        int size()
          throws java.rmi.RemoteException
        Returns the number of elements in this collection.
        Returns:
        the number of elements in this collection
        Throws:
        java.rmi.RemoteException - remote communication problem
      • isEmpty

        boolean isEmpty()
                 throws java.rmi.RemoteException
        Returns true if this collection contains no elements.
        Returns:
        true if this collection contains no elements
        Throws:
        java.rmi.RemoteException - remote communication problem
      • contains

        boolean contains​(E o)
                  throws java.rmi.RemoteException
        Returns truee if this collection contains the specified element.
        Parameters:
        o - element whose presence in this collection is to be tested
        Returns:
        truee if this collection contains the specified element
        Throws:
        java.rmi.RemoteException - remote communication problem
      • containsAll

        boolean containsAll​(java.util.Collection<? extends E> c)
                     throws java.rmi.RemoteException
        Returns true if this collection contains all the elements in the given collection.
        Parameters:
        c - collection of elements whose presence in this collection is to be tested
        Returns:
        truee if this collection contains all the specified elements
        Throws:
        java.rmi.RemoteException - remote communication problem
      • deleteAll

        boolean deleteAll​(java.util.Collection<?> c)
                   throws java.rmi.RemoteException
        Removes all of this collection's elements that are contained in the given collection.
        Parameters:
        c - collection containing elements to be removed from this collection
        Returns:
        true if this collection was changed as a result of the call
        Throws:
        java.rmi.RemoteException - remote communication problem
      • retainAll

        boolean retainAll​(java.util.Collection<?> c)
                   throws java.rmi.RemoteException
        Removes all of this collection's elements that are not contained in the specified collection.
        Parameters:
        c - collection containing elements to be retained in this collection
        Returns:
        true if this collection was changed as a result of the call
        Throws:
        java.rmi.RemoteException - remote communication problem
      • clear

        void clear()
            throws java.rmi.RemoteException
        Remove all elements from this collection.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • asIterable

        IterableRemoteCollection<E> asIterable()
                                        throws java.rmi.RemoteException
        Description copied from interface: RemoteIterable
        Provides an Iterable view of this RemoteIterable. This normally uses RemoteIterable.remoteIterator() and wraps the return value into a real Iterator that throws RuntimeExceptions instead of RemoteExceptions so that this view can be used in for-each loops.
        Specified by:
        asIterable in interface RemoteIterable<E>
        Returns:
        an iterable view of this RemoteIterable
        Throws:
        java.rmi.RemoteException - remote communication problem
        See Also:
        ApiIterator