Class IterableRemoteIndexedList<KEY,​T>

  • Type Parameters:
    KEY - the type of the keys of this indexed list
    T - the type of elements in this indexed list
    All Implemented Interfaces:
    RemoteCollection<T>, RemoteIndexedList<KEY,​T>, RemoteList<T>, TptRemote, RemoteIterable<T>, java.io.Serializable, java.lang.Iterable<T>, java.rmi.Remote

    public class IterableRemoteIndexedList<KEY,​T>
    extends IterableRemoteList<T>
    implements RemoteIndexedList<KEY,​T>
    A wrapper obejct to provide iterable functionallity for a RemoteIndexedList. Since all methods of a Remote interface must throw a RemoteException we cannot implement Iterable directly.
    This wrapper has the same interface as a RemoteCollection and additionally implements the Iterable interface. Since the methods of the latter do not throw RemoteException this Object cannot be exported as a RemoteObject.
    Author:
    Copyright (c) 2014-2024 Piketec GmbH - MIT License (MIT) - All rights reserved
    See Also:
    Serialized Form
    • Constructor Detail

      • IterableRemoteIndexedList

        public IterableRemoteIndexedList​(RemoteIndexedList<KEY,​T> delegate)
        An iterable view on a RemoteIndexedList. Most likely not needed by API users.
        Parameters:
        delegate - The remote indexed list for which an iterable view is needed.
        See Also:
        RemoteIndexedList.asIterable()
    • Method Detail

      • get

        public T get​(KEY key)
              throws ApiException,
                     java.rmi.RemoteException
        Description copied from interface: RemoteIndexedList
        Returns the value object for the given key or null if no such value exists.
        Specified by:
        get in interface RemoteIndexedList<KEY,​T>
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        the value object for the given key
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException
      • getKey

        public KEY getKey​(T obj)
                   throws java.rmi.RemoteException
        Description copied from interface: RemoteIndexedList
        Returns the key that belongs to the given value object.
        Specified by:
        getKey in interface RemoteIndexedList<KEY,​T>
        Parameters:
        obj - the value object whose key is to be returned
        Returns:
        the key that belongs to the given value object
        Throws:
        java.rmi.RemoteException - remote communication problem
      • removeByKey

        public T removeByKey​(KEY key)
                      throws java.rmi.RemoteException
        Description copied from interface: RemoteIndexedList
        Removes the object with the given key from the list.
        Specified by:
        removeByKey in interface RemoteIndexedList<KEY,​T>
        Parameters:
        key - the key whose associated value is to be removed
        Returns:
        the removed object with the specified key
        Throws:
        java.rmi.RemoteException - remote communication problem
      • containsKey

        public boolean containsKey​(KEY key)
                            throws java.rmi.RemoteException
        Description copied from interface: RemoteIndexedList
        Returns true if this list contains an object with the given key.
        Specified by:
        containsKey in interface RemoteIndexedList<KEY,​T>
        Parameters:
        key - the key whose presence in this list is to be tested
        Returns:
        true if this list contains an object for the specified key
        Throws:
        java.rmi.RemoteException - remote communication problem
      • keySet

        public RemoteCollection<KEY> keySet()
                                     throws java.rmi.RemoteException
        Description copied from interface: RemoteIndexedList
        Returns a set of the keys contained in this list.
        Specified by:
        keySet in interface RemoteIndexedList<KEY,​T>
        Returns:
        set of keys
        Throws:
        java.rmi.RemoteException - remote communication problem