Sharkysoft home

lava.security
Class IdentityTextTransform

java.lang.Object
  |
  +--lava.security.IdentityTextTransform

public final class IdentityTextTransform
extends java.lang.Object
implements ITextTransform

Identity transform.

Details: This class is the identity text transform, or a text transform which produces an output symbol sequence equivalent to the input symbol sequence it consumes. As with any implementation of ITextTransform, the input and output array types may be different. Regardless of the array types, IdentityTextTransform converts the input symbols into symbols that can be stored in the destination array, provided that the destination array's type is wide enough for the symbol size.

This class implements the ITextTransform API. See the ITextTransform documentation for more information.

An additional feature of this transform is that if any of the padding bits in the input block are not 0, they will be zeroed in the output. (Note that this behavior is provided as a convenience and is not required by the ITextTransform interface. In many ways, this "extra feature" makes this implementation similar to the ArrayCaster classes in package lava.array.)

Since:
1999.08.16
Author:
Sharky

Constructor Summary
IdentityTextTransform(int width)
          Sets symbol width.
 
Method Summary
 void beginTransform()
          No operation.
 int completeTransform(java.lang.Object ignored)
          No operation.
 int continueTransform(java.lang.Object input, java.lang.Object output, int len)
          Converts symbols.
 int getTransformInputWidth()
          Returns symbol width.
 int getTransformOutputWidth()
          Returns symbol width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityTextTransform

public IdentityTextTransform(int width)
Sets symbol width.

Details: This constructor initializes an identity transform for symbols of the given width (width).

Parameters:
width - the symbol width
Method Detail

beginTransform

public void beginTransform()
No operation.

Details: beginTransform does absolutely nothing in this implementation.

Specified by:
beginTransform in interface ITextTransform

continueTransform

public int continueTransform(java.lang.Object input,
                             java.lang.Object output,
                             int len)
Converts symbols.

Details: continueTransform performs the identity transform described in the introduction to this class.

Overflow symbols are discarded. (See overflow discussion in ITextTransform.)

Specified by:
continueTransform in interface ITextTransform
Parameters:
input - the input text
output - the output text
Returns:
number of symbols generated

completeTransform

public final int completeTransform(java.lang.Object ignored)
No operation.

Details: completeTransform does absolutely nothing in this implementation.

Specified by:
completeTransform in interface ITextTransform
Parameters:
ignored - ignored
Returns:
0

getTransformInputWidth

public final int getTransformInputWidth()
Returns symbol width.
Specified by:
getTransformInputWidth in interface ITextTransform
Returns:
width parameter from constructor

getTransformOutputWidth

public final int getTransformOutputWidth()
Returns symbol width.
Specified by:
getTransformOutputWidth in interface ITextTransform
Returns:
width parameter from constructor

Sharkysoft home