Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 0.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
import java.util.*;
public class CircularityTracker {
private IdentityHashMap refs = new IdentityHashMap();
/**
- Get the reference is of the object if it has been tracked.
- @param o
- @return -1 if not contained, otherwise the reference id.
*/
public int contains(Object o) { Object value = refs.get(o); if( value == null ) return -1; return ((Integer)value).intValue(); }
/**
- Starts tracking the object. Returns its tracking reference for use in xml.
- @param o
- @return
*/
public int track(Object o) { Integer size = new Integer(refs.size()); refs.put(o, size); return size.intValue(); }}
CircularityTracker is now dead.