Top Description Inners Fields Constructors Methods
org.apache.tools.ant.util

public Class WeakishReference

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.util.WeakishReference.HardReference
Annotations
@Deprecated
Imports
java.lang.ref.WeakReference

Deprecated

deprecated 1.7; will be removed in Ant1.8 Just use java.lang.ref.WeakReference directly.

These classes are part of some code to reduce memory leaks by only retaining weak references to things on Java1.2+, and yet still work (with leaky hard references) on Java1.1. Now that Ant is 1.2+ only, life is simpler and none of the classes are needed any more. They are only retained in case a third-party task uses them
Since
ant1.6
See Also
org.apache.tools.ant.util.optional.WeakishReference12

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
WeakishReference.HardReference

Deprecated since 1.7. Hopefully nobody is using this.
This was a hard reference for Java 1.1.

Field Summary

Modifier and TypeField and Description
private WeakReference<Object>

Constructor Summary

AccessConstructor and Description
pack-priv
WeakishReference(Object
ditto
reference
)

create a new soft reference, which is bound to a Weak reference inside

Method Summary

Modifier and TypeMethod and Description
public static WeakishReference

Returns:

reference to the Object.
createReference
(Object
the object that the reference will refer to.
object
)

Deprecated as a consequence of WeakishReference being deprecated.
create the appropriate type of reference for the java version
public Object

Returns:

The object to which this reference refers, or null if this reference object has been cleared.
get
()

Returns this reference object's referent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

weakrefback to summary
private WeakReference<Object> weakref

Constructor Detail

WeakishReferenceback to summary
pack-priv WeakishReference(Object reference)

create a new soft reference, which is bound to a Weak reference inside

Parameters
reference:Object

ditto

See Also
java.lang.ref.WeakReference

Method Detail

createReferenceback to summary
public static WeakishReference createReference(Object object)

Deprecated

as a consequence of WeakishReference being deprecated. See corresponding docs for further information.

create the appropriate type of reference for the java version

Parameters
object:Object

the object that the reference will refer to.

Returns:WeakishReference

reference to the Object.

getback to summary
public Object get()

Returns this reference object's referent. If this reference object has been cleared, then this method returns null.

Returns:Object

The object to which this reference refers, or null if this reference object has been cleared.

org.apache.tools.ant.util back to summary

public Class WeakishReference.HardReference

extends WeakishReference
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.util.optional.WeakishReference12

Deprecated

since 1.7. Hopefully nobody is using this.

This was a hard reference for Java 1.1. Since Ant1.7,

Constructor Summary

AccessConstructor and Description
public
HardReference(Object
the object that the reference will refer to.
object
)

constructor.

Method Summary

Inherited from org.apache.tools.ant.util.WeakishReference:
createReferenceget

Constructor Detail

HardReferenceback to summary
public HardReference(Object object)

constructor.

Parameters
object:Object

the object that the reference will refer to.