uk.org.ogsadai.client.toolkit.activity.transform
Class GZIPChecksum

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.transform.GZIPChecksum

public class GZIPChecksum
extends java.lang.Object

An enumerated type representing a GZIP checksum type - Adler or CRC.

Author:
The OGSA-DAI Project Team

Field Summary
static java.lang.String ADLER
          Adler checksum.
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
static java.lang.String CRC
          CRC checksum.
private  java.lang.String mType
          The current checksum type.
 
Constructor Summary
GZIPChecksum(java.lang.String type)
          Create a GZIPChecksum of the specified type.
 
Method Summary
 java.lang.String getAsString()
          Return the checksum type as a string - either adler32 or crc32.
 boolean isAdler()
          Is the current checksum type Adler?
 boolean isCRC()
          Is the current checksum type CRC?
 void setAdler()
          Set the checksum type to be Adler
 void setCRC()
          Set the checksum type to be CRC
 void setType(java.lang.String type)
          Set the checksum type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

ADLER

public static final java.lang.String ADLER
Adler checksum.

See Also:
Constant Field Values

CRC

public static final java.lang.String CRC
CRC checksum.

See Also:
Constant Field Values

mType

private java.lang.String mType
The current checksum type.

Constructor Detail

GZIPChecksum

public GZIPChecksum(java.lang.String type)
Create a GZIPChecksum of the specified type.

Parameters:
type - One of GZIPChecksum.ADLER for Adler or GZIPChecksum.CRC for CRC.
Throws:
java.lang.IllegalArgumentException - If type is neither of the two alternatives above.
Method Detail

setType

public void setType(java.lang.String type)
Set the checksum type.

Parameters:
type - One of GZIPChecksum.ADLER for Adler or GZIPChecksum.CRC for CRC.
Throws:
java.lang.IllegalArgumentException - If type is neither of the two alternatives above.

setCRC

public void setCRC()
Set the checksum type to be CRC


setAdler

public void setAdler()
Set the checksum type to be Adler


isAdler

public boolean isAdler()
Is the current checksum type Adler?

Returns:
true if type is ADLER.

isCRC

public boolean isCRC()
Is the current checksum type CRC?

Returns:
true if type is CRC.

getAsString

public java.lang.String getAsString()
Return the checksum type as a string - either adler32 or crc32.

Returns:
type