fulmine.util.reference
Interface IReferenceCounter<TYPE>

Type Parameters:
TYPE - the type of object this counter works with
All Known Implementing Classes:
ReferenceCounter

public interface IReferenceCounter<TYPE>

Handles reference counting for objects.

Author:
Ramon Servadei

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.
 

Method Detail

getCount

int getCount(TYPE target)
Get the number of references for the target. This operation uses Object.equals(Object) to find the reference counts for the target.

Parameters:
target - the target object to find the number of references for
Returns:
the number of references for the target

adjustCount

int adjustCount(TYPE target,
                int delta)
Adjust the number of reference counts for the target object by the delta. The delta can be positive or negative. This operation never results in a negative reference count. This operation uses Object.equals(Object) to find the reference counts for the target.

Parameters:
target - the target object to adjust the number of references for
delta - the change in the reference count for the object
Returns:
the number of references for the target after this operation completes. This is never less than 0.

clear

void clear()
Clear all reference counts.



Copyright © 2007-2009. All Rights Reserved.