Interface ObjectCollection<K>

    • Method Detail

      • iterator

        ObjectIterator<K> iterator()
        Returns a type-specific iterator on the elements of this collection.

        Note that this specification strengthens the one given in Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extends Collection.

        Specified by:
        iterator in interface Collection<K>
        Specified by:
        iterator in interface Iterable<K>
        Specified by:
        iterator in interface ObjectIterable<K>
        Returns:
        a type-specific iterator on the elements of this collection.
      • toArray

        <T> T[] toArray​(T[] a)
        Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.

        Warning: Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.

        Specified by:
        toArray in interface Collection<K>
        Parameters:
        a - if this array is big enough, it will be used to store this collection.
        Returns:
        a primitive type array containing the items of this collection.
        See Also:
        Collection.toArray(Object[])