public class SafeSortedMap.Split extends Object
Modifier and Type | Field and Description |
---|---|
protected float |
m_flHeadWeight
The estimated weight of the head portion of the split, expressed as
a ratio of the size of the headMap to the size of the underlying
SafeSortedMap.
|
protected SortedMap |
m_mapHead
The headMap.
|
protected SortedMap |
m_mapTail
The tailMap.
|
Modifier | Constructor and Description |
---|---|
protected |
Split(Object oKey)
Construct a split at the specified key.
|
Modifier and Type | Method and Description |
---|---|
protected float |
calculateHeadWeight()
Estimate the weight of the head portion of the Split.
|
SortedMap |
getHead()
Return front of the split.
|
float |
getHeadWeight()
Return the estimated weight of the head portion of the
SafeSortedMap.Split . |
Object |
getSplitKey()
Return the key around which this is
SafeSortedMap.Split is defined. |
SortedMap |
getTail()
Return tail of the split
|
float |
getTailWeight()
Return the estimated weight of the tail portion of the
SafeSortedMap.Split . |
boolean |
isHeadHeavy()
Return true if the estimated weight of the head of the split is
larger than the tail.
|
protected int |
quickLog(int n,
int nBase)
Calculate and return the floor of lognBase(n).
|
protected SortedMap m_mapHead
protected SortedMap m_mapTail
protected float m_flHeadWeight
protected Split(Object oKey)
oKey
- the key at which to splitprotected int quickLog(int n, int nBase)
n
- the number to take the logarithm ofnBase
- the base with which to compute the logarithmprotected float calculateHeadWeight()
public SortedMap getHead()
public SortedMap getTail()
public float getHeadWeight()
SafeSortedMap.Split
.
The weight is expressed as a ratio of the size of the headMap to the
size of the underlying SafeSortedMap.
Note: this method is not guaranteed to return an exact answer, but rather uses a heuristic to make an estimate. For an exact answer, the more expensive size() methods should be used.
public float getTailWeight()
SafeSortedMap.Split
.
The weight is expressed as a ratio of the size of the tailMap to the
size of the underlying SafeSortedMap.
Note: this method is not guaranteed to return an exact answer, but rather uses a heuristic to make an estimate. For an exact answer, the more expensive size() methods should be used.
public boolean isHeadHeavy()
getHeadWeight()
public Object getSplitKey()
SafeSortedMap.Split
is defined.SafeSortedMap.Split
is defined