org.jpos.iso
Class RightTPadder
java.lang.Object
org.jpos.iso.RightPadder
org.jpos.iso.RightTPadder
- All Implemented Interfaces:
- Padder
public class RightTPadder
- extends RightPadder
Implements the Padder interface for padding strings and byte arrays on the
Right. The difference between this and RightPadder is that this truncates the data
during packing, instead of throwing an exception.
- Version:
- $Revision: 2594 $ $Date: 2008-01-22 08:41:31 -0800 (Tue, 22 Jan 2008) $
- Author:
- jonathan.oconnor@xcom.de
|
Constructor Summary |
RightTPadder(char pad)
Creates a Right Truncating Padder with a specific pad character. |
|
Method Summary |
java.lang.String |
pad(java.lang.String data,
int maxLength)
Returns a padded string upto a maximum length. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SPACE_PADDER
public static final RightTPadder SPACE_PADDER
- A padder for padding spaces on the right. This is very common in
alphabetic fields.
RightTPadder
public RightTPadder(char pad)
- Creates a Right Truncating Padder with a specific pad character.
- Parameters:
pad - The padding character. For binary padders, the pad character
is truncated to lower order byte.
pad
public java.lang.String pad(java.lang.String data,
int maxLength)
throws ISOException
- Description copied from interface:
Padder
- Returns a padded string upto a maximum length. If the data is longer
than maxLength, then the data is truncated.
- Specified by:
pad in interface Padder- Overrides:
pad in class RightPadder
- Parameters:
data - The string to pad.maxLength - The maximum length of the padded string.
- Returns:
- A padded string.
- Throws:
ISOException- See Also:
org.jpos.iso.Padder#pad(java.lang.String, int,
char)