org.crosswire.common.compress
Enum CompressorType

java.lang.Object
  extended by java.lang.Enum<CompressorType>
      extended by org.crosswire.common.compress.CompressorType
All Implemented Interfaces:
Serializable, Comparable<CompressorType>

public enum CompressorType
extends Enum<CompressorType>

An Enumeration of the possible Compressions.

Author:
DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Enum Constant Summary
LZSS
           
ZIP
           
 
Method Summary
static CompressorType fromString(String name)
          Get a CompressorType from a String
abstract  Compressor getCompressor(byte[] input)
          Get a compressor.
static CompressorType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CompressorType[] 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

ZIP

public static final CompressorType ZIP

LZSS

public static final CompressorType LZSS
Method Detail

values

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

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

valueOf

public static CompressorType 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

getCompressor

public abstract Compressor getCompressor(byte[] input)
Get a compressor.

Parameters:
input - the stream to compress or to uncompress.

fromString

public static CompressorType fromString(String name)
Get a CompressorType from a String

Parameters:
name - the case insensitive representation of the desired CompressorType
Returns:
the desired compressor or null if not found.

Copyright ? 2003-2011