Package it.unimi.dsi.fastutil
Interface Size64
- All Known Subinterfaces:
BigList<K>
public interface Size64
An interface for data structures whose size can exceed
Integer.MAX_VALUE.
The only methods specified by this interfaces are size64(), and
a deprecated size() identical to Collection.size(),
but with a default implementation. Implementations
can work around the type problem of Collection.size()
(e.g., not being able to return more than Integer.MAX_VALUE) by implementing this
interface. Callers interested in large structures
can use a reflective call to instanceof to check for the presence of size64().
-
Method Summary
Modifier and TypeMethodDescriptiondefault intsize()Deprecated.longsize64()Returns the size of this data structure as a long.static longsizeOf(Collection<?> c) Returns the size for a givenCollectionas along, usingsize64()if applicable, else usingCollection.size().static long
-
Method Details
-
size64
long size64()Returns the size of this data structure as a long.- Returns:
- the size of this data structure.
-
size
Deprecated.Usesize64()instead.Returns the size of this data structure, minimized withInteger.MAX_VALUE.This default implementation follows the definition above, which is compatible with
Collection.size().- Returns:
- the size of this data structure, minimized with
Integer.MAX_VALUE. - See Also:
-
sizeOf
Returns the size for a givenCollectionas along, usingsize64()if applicable, else usingCollection.size().- Parameters:
c- the collection whose size to get- Returns:
- the size
-
sizeOf
- Parameters:
m- the map whose size to get- Returns:
- the size
-
size64()instead.