|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fulmine.util.reference.ReferenceCounter<TYPE>
TYPE
- the type of objects this counter works withpublic final class ReferenceCounter<TYPE>
Standard implementation, not thread safe.
Constructor Summary | |
---|---|
ReferenceCounter()
Construct the counter with a default entry size of 2 |
|
ReferenceCounter(int size)
Construct the counter with a specific entry size |
Method Summary | |
---|---|
int |
adjustCount(TYPE target,
int delta)
Adjust the number of reference counts for the target object by the delta. |
void |
clear()
Clear all reference counts. |
int |
getCount(TYPE target)
Get the number of references for the target. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReferenceCounter()
public ReferenceCounter(int size)
size
- the entry sizeMethod Detail |
---|
public int adjustCount(TYPE target, int delta)
IReferenceCounter
Object.equals(Object)
to find the reference counts for the
target.
adjustCount
in interface IReferenceCounter<TYPE>
target
- the target object to adjust the number of references fordelta
- the change in the reference count for the object
public int getCount(TYPE target)
IReferenceCounter
Object.equals(Object)
to find the reference counts for the
target.
getCount
in interface IReferenceCounter<TYPE>
target
- the target object to find the number of references for
public void clear()
IReferenceCounter
clear
in interface IReferenceCounter<TYPE>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |