TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.socket
Enum IOCache.Strategy

java.lang.Object
  extended by java.lang.Enum<IOCache.Strategy>
      extended by de.schlichtherle.truezip.socket.IOCache.Strategy
All Implemented Interfaces:
Serializable, Comparable<IOCache.Strategy>
Enclosing class:
IOCache

public static enum IOCache.Strategy
extends Enum<IOCache.Strategy>

Provides different cache strategies.


Enum Constant Summary
READ_ONLY
          Any attempt to obtain an output socket will result in a NullPointerException.
WRITE_BACK
          A write-back cache flushes any written data if and only if it gets explicitly flushed.
WRITE_THROUGH
          A write-through cache flushes any written data as soon as the output stream created by IOCache.getOutputSocket() gets closed.
 
Method Summary
 IOCache newCache(IOPool<?> pool)
          Returns a new cache.
(package private)  IOCache.InputBufferPool newInputBufferPool(IOCache cache)
           
(package private) abstract  IOCache.OutputBufferPool newOutputBufferPool(IOCache cache)
           
static IOCache.Strategy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static IOCache.Strategy[] 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

READ_ONLY

public static final IOCache.Strategy READ_ONLY
Any attempt to obtain an output socket will result in a NullPointerException.


WRITE_THROUGH

public static final IOCache.Strategy WRITE_THROUGH
A write-through cache flushes any written data as soon as the output stream created by IOCache.getOutputSocket() gets closed.


WRITE_BACK

public static final IOCache.Strategy WRITE_BACK
A write-back cache flushes any written data if and only if it gets explicitly flushed.

Method Detail

values

public static IOCache.Strategy[] 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 (IOCache.Strategy c : IOCache.Strategy.values())
    System.out.println(c);

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

valueOf

public static IOCache.Strategy 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

newCache

public IOCache newCache(IOPool<?> pool)
Returns a new cache.

Parameters:
pool - the pool of temporary entries to cache the entry data.
Returns:
A new cache.

newInputBufferPool

IOCache.InputBufferPool newInputBufferPool(IOCache cache)

newOutputBufferPool

abstract IOCache.OutputBufferPool newOutputBufferPool(IOCache cache)

TrueZIP Kernel 7.0-rc1

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