|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.dtfj.analyzer.util.MarkSet
public class MarkSet
Define a mark bit which can be applied to a given object ID represented by a long.
We know that the incoming IDs are not necessarily dense or zero origined and so this
class attempts to solve the sparse addressing problem by lazily allocating mark regions.
In the case of JavaObjects we also know that they are allocated on defined boundaries
and we can take advantage of that to further compress this set.
See ObjectMarkSet
Field Summary | |
---|---|
static int |
DEFAULT_MAX
The default value for the max ID |
static int |
DEFAULT_PAGE
Size for the second level index |
static int |
DEFAULT_TOP
The default size of the top level index |
Constructor Summary | |
---|---|
MarkSet()
Build a Mark set with default max size |
|
MarkSet(long maxID)
Build a Mark set with given max size |
|
MarkSet(MarkSet copy)
Build a Mark set as a copy of another one |
Method Summary | |
---|---|
MarkSet |
and(MarkSet other)
And this set with another given set and return the result. |
void |
clear()
Clear all marks |
void |
clearMark(long id)
Forget that the given ID has been marked |
protected void |
computeAnd(MarkSet other,
MarkSet newSet)
|
protected void |
computeOr(MarkSet other,
MarkSet newSet)
|
protected void |
computeXor(MarkSet other,
MarkSet newSet)
|
long |
countMarks()
Count all the marks |
long |
getMaxID()
What is the largest allowed mark ID |
boolean |
isMarked(long id)
Has the given ID been marked |
MarkSet |
or(MarkSet other)
Or this set with another given set and return the result. |
void |
setMark(long id)
Remember that the given ID has been marked |
MarkSet |
xor(MarkSet other)
Exclusive or this set with another given set and return the result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_TOP
public static final int DEFAULT_PAGE
public static final int DEFAULT_MAX
Constructor Detail |
---|
public MarkSet()
public MarkSet(long maxID)
maxID
- value of largest allowed IDpublic MarkSet(MarkSet copy)
copy
- the set to copyMethod Detail |
---|
public long getMaxID()
public void setMark(long id)
id
- the ID to markpublic void clearMark(long id)
id
- the ID to unmarkpublic boolean isMarked(long id)
id
- the required ID
public void clear()
public long countMarks()
public MarkSet and(MarkSet other)
other
- the set to and this one with
protected void computeAnd(MarkSet other, MarkSet newSet)
public MarkSet or(MarkSet other)
other
- the set to or this one with
protected void computeOr(MarkSet other, MarkSet newSet)
public MarkSet xor(MarkSet other)
other
- the set to or this one with
protected void computeXor(MarkSet other, MarkSet newSet)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |