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:
The GNU Lesser General Public License for details.

Enum Constant Summary
BZIP2
           
GZIP
           
LZSS
           
XZ
           
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

BZIP2

public static final CompressorType BZIP2

GZIP

public static final CompressorType GZIP

XZ

public static final CompressorType XZ
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.
Returns:
the compressor for the stream

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-2015