public interface Size64
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()
.
Modifier and Type | Method and Description |
---|---|
default int |
size()
Deprecated.
Use
size64() instead. |
long |
size64()
Returns the size of this data structure as a long.
|
static long |
sizeOf(java.util.Collection<?> c)
Returns the size for a given
Collection as a long , using size64()
if applicable, else using Collection.size() . |
static long |
sizeOf(java.util.Map<?,?> m)
|
long size64()
@Deprecated default int size()
size64()
instead.Integer.MAX_VALUE
.
This default implementation follows the definition above, which is compatible
with Collection.size()
.
Integer.MAX_VALUE
.Collection.size()
static long sizeOf(java.util.Collection<?> c)
Collection
as a long
, using size64()
if applicable, else using Collection.size()
.c
- the collection whose size to getstatic long sizeOf(java.util.Map<?,?> m)
m
- the map whose size to get