org.apache.lucene.gdata.utils
Class ReferenceCounter<Type>
java.lang.Object
org.apache.lucene.gdata.utils.ReferenceCounter<Type>
- Type Parameters:
Type
- -
the type of the object
public abstract class ReferenceCounter<Type>
- extends Object
A reference counting utility. This is use to keep track of released objects
of Type
.
- Author:
- Simon Willnauer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
resource
protected final Type resource
ReferenceCounter
public ReferenceCounter(Type resource)
- Parameters:
resource
- -
the resource to track
decrementRef
public final void decrementRef()
- Decrements the reference. If no references remain the
close()
method will be invoked;
close
protected abstract void close()
- A custom implementation. Performs an action if no reference remaining
increamentReference
public final ReferenceCounter<Type> increamentReference()
- Increments the reference
- Returns:
- the reference object
get
public final Type get()
- Returns:
- - the resource to keep track of
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.