IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.base
Class Compressor

java.lang.Object
  extended bycom.ibm.dse.base.FormatElement
      extended bycom.ibm.dse.base.FormatDecorator
          extended bycom.ibm.dse.base.Compressor
All Implemented Interfaces:
Cacheable, Externalizable, java.io.Externalizable, java.io.Serializable

public class Compressor
extends FormatDecorator

This decorator compresses its decorated String in order to reduce the decorated string size.

See Also:
Serialized Form

Field Summary
protected  int bufferSize
           
static int DEFAULT_BUFFER_SIZE
           
static byte DEFAULT_COMPRESSION
           
 
Fields inherited from class com.ibm.dse.base.FormatDecorator
decorated
 
Fields inherited from class com.ibm.dse.base.FormatElement
dataElementName, externalizer, name
 
Constructor Summary
Compressor()
          This constructor creates a Compressor object.
Compressor(java.lang.String aName)
          This constructor creates a new instance of the Compressor class, which is obtained from the external definition files through aName.
 
Method Summary
 java.lang.String addDecoration(java.lang.String aString)
          Compresses the aString parameter and returns the compressed String.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a Compressor with the aTag attributes.
 java.lang.String removeDecoration(java.lang.String aString)
          Returns the uncompressed String resulting from aString.
 java.lang.String removeDecoration(java.lang.String aString, int intArray)
          Returns the uncompressed String resulting from aString.
 Vector toStrings()
          Return a visual representation of the Compressor object.
 
Methods inherited from class com.ibm.dse.base.FormatDecorator
extract, format, format, getDataElementName, getDecorated, getName, isConstant, isItConstant, reinitialize, rootDecorated, rootDecorator, setDecorated, toString, unformat, unformat
 
Methods inherited from class com.ibm.dse.base.FormatElement
exceptionInfo, externalizer, format, getExternalizer, getTagName, isCacheable, readExternal, readExternal, readObject, removeExternal, setDataElementName, setExternalizer, setName, setSize, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_COMPRESSION

public static final byte DEFAULT_COMPRESSION
See Also:
Constant Field Values

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values

bufferSize

protected int bufferSize
Constructor Detail

Compressor

public Compressor()
This constructor creates a Compressor object.


Compressor

public Compressor(java.lang.String aName)
           throws java.io.IOException
This constructor creates a new instance of the Compressor class, which is obtained from the external definition files through aName.

Parameters:
aName - java.lang.String
Method Detail

addDecoration

public java.lang.String addDecoration(java.lang.String aString)
                               throws DSEInvalidArgumentException
Compresses the aString parameter and returns the compressed String. The compression is done like a ZIP compression, using the classes provided by the package java.util.zip. The result cannot be accessed by an external application using ZIP compression because the ZIP headers are not included into the compressed String.

Specified by:
addDecoration in class FormatDecorator
Throws:
DSEInvalidArgumentException

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
Initializes a Compressor with the aTag attributes.

Specified by:
initializeFrom in interface Externalizable
Specified by:
initializeFrom in class FormatElement
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
Object

removeDecoration

public java.lang.String removeDecoration(java.lang.String aString)
                                  throws DSEInvalidArgumentException
Returns the uncompressed String resulting from aString.

Specified by:
removeDecoration in class FormatDecorator
Parameters:
aString - String
Returns:
java.lang.String
Throws:
DSEInvalidArgumentException

toStrings

public Vector toStrings()
Return a visual representation of the Compressor object.

Specified by:
toStrings in interface Externalizable
Specified by:
toStrings in class FormatDecorator
Returns:
java.lang.String

removeDecoration

public java.lang.String removeDecoration(java.lang.String aString,
                                         int intArray)
                                  throws DSEInvalidArgumentException
Returns the uncompressed String resulting from aString.

Parameters:
aString - java.lang.String
intArray - int
Returns:
java.lang.String
Throws:
DSEInvalidArgumentException - - The exception description

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005