public static class INTargetRep.Sparse extends INTargetRep
INTargetRep.Default, INTargetRep.None, INTargetRep.Sparse, INTargetRep.Type
Modifier and Type | Field and Description |
---|---|
(package private) short[] |
idxs |
static int |
MAX_ENTRIES |
static int |
MAX_INDEX |
(package private) Node[] |
targets |
NONE
Constructor and Description |
---|
INTargetRep.Sparse(int capacity) |
INTargetRep.Sparse(SizeofMarker marker) |
Modifier and Type | Method and Description |
---|---|
long |
calculateMemorySize()
Returns the current memory size of the underlying representation in
bytes.
|
INTargetRep |
compact(IN parent)
Chooses a more compact representation, if that's possible, otherwise
does nothing.
|
INTargetRep |
copy(int from,
int to,
int n,
IN parent)
Copies n elements at index denoted by "from" to the index denoted by
"to".
|
Node |
get(int j)
Returns the element at idx.
|
INTargetRep.Type |
getType() |
INTargetRep |
set(int j,
Node node,
IN parent)
Sets the array element at idx to the node.
|
void |
updateCacheStats(boolean increment,
Evictor evictor)
Update the cache statistics for this representation.
|
noteRepChange, updateCacheStats
public static final int MAX_ENTRIES
public static final int MAX_INDEX
final short[] idxs
final Node[] targets
public INTargetRep.Sparse(int capacity)
public INTargetRep.Sparse(SizeofMarker marker)
public INTargetRep.Type getType()
getType
in class INArrayRep<INTargetRep,INTargetRep.Type,Node>
public long calculateMemorySize()
INArrayRep
calculateMemorySize
in class INArrayRep<INTargetRep,INTargetRep.Type,Node>
public INTargetRep copy(int from, int to, int n, IN parent)
INArrayRep
copy
in class INArrayRep<INTargetRep,INTargetRep.Type,Node>
from
- the source (inclusive) of the copyto
- the target (inclusive) of the copyn
- the number of elements to be copied.public Node get(int j)
INArrayRep
get
in class INArrayRep<INTargetRep,INTargetRep.Type,Node>
public INTargetRep set(int j, Node node, IN parent)
INArrayRep
set
in class INArrayRep<INTargetRep,INTargetRep.Type,Node>
j
- the index to be setnode
- the array elelement at the idxpublic INTargetRep compact(IN parent)
INArrayRep
WARNING: This method must not change the memory size of the current representation and return 'this', without explicitly adjusting memory usage (via noteRepChange) before returning. Returning a new instance is the trigger for adjusting memory usage in the parent.
compact
in class INArrayRep<INTargetRep,INTargetRep.Type,Node>
public void updateCacheStats(boolean increment, Evictor evictor)
INArrayRep
updateCacheStats
in class INArrayRep<INTargetRep,INTargetRep.Type,Node>
increment
- true the stat should be incremented, false if it must
be decrementedevictor
- the evictor that shoulds ths stat counters#updateCacheStats(boolean)
Copyright (c) 2004-2012 Oracle. All rights reserved.