TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.util
Enum Link.Type

java.lang.Object
  extended by java.lang.Enum<Link.Type>
      extended by de.schlichtherle.truezip.util.Link.Type
All Implemented Interfaces:
Serializable, Comparable<Link.Type>
Enclosing interface:
Link<T>

public static enum Link.Type
extends Enum<Link.Type>

A link type defines the terms and conditions for clearing its target and is a factory for


Nested Class Summary
private static class Link.Type.SoftLink<T>
          Adapts its subclass to the Link interface.
private static class Link.Type.StrongLink<T>
          A strong reference.
private static class Link.Type.WeakLink<T>
          Adapts its subclass to the Link interface.
 
Enum Constant Summary
SOFT
          This reference type clears the target of a link according to the terms and conditions of a SoftReference.
STRONG
          This reference type never clears the target of a link.
WEAK
          This reference type clears the target of a link according to the terms and conditions of a WeakReference.
 
Method Summary
abstract
<T> Link<T>
newLink(T target)
          Returns a new typed link to the given nullable target.
static Link.Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Link.Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STRONG

public static final Link.Type STRONG
This reference type never clears the target of a link.


SOFT

public static final Link.Type SOFT
This reference type clears the target of a link according to the terms and conditions of a SoftReference.


WEAK

public static final Link.Type WEAK
This reference type clears the target of a link according to the terms and conditions of a WeakReference.

Method Detail

values

public static Link.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Link.Type c : Link.Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Link.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

newLink

@NonNull
public abstract <T> Link<T> newLink(@Nullable
                                            T target)
Returns a new typed link to the given nullable target.


TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.