com.ivata.mask.web.format
Class LeadingCharacterFormat

java.lang.Object
  extended bycom.ivata.mask.web.format.LeadingCharacterFormat
All Implemented Interfaces:
HTMLFormat

public class LeadingCharacterFormat
extends java.lang.Object
implements HTMLFormat

Format a string by appending a leading character. You can specify either an absolute length of the final string, or a number of characters to append.

Since:
ivata masks 0.4 (2002-10-24)
Version:
$Revision: 1.3 $
Author:
Colin MacLeod colin.macleod@ivata.com

Constructor Summary
LeadingCharacterFormat()
           
 
Method Summary
 java.lang.String format(java.lang.String hTMLText)
           Takes the text provided and prepends the character defined in setCharacterthe number of times defined in setCount.
 char getCharacter()
           This character will be prepended to the string.
 int getCount()
           The number of times the character will be prepended.
 boolean getCountIsMaximum()
           Get whether the number specified in setCountshould be a maximum string length, or the number of characters to prepend.
 void setCharacter(char characterParam)
           This character will be prepended to the string.
 void setCount(int countParam)
           The number of times the character will be prepended.
 void setCountIsMaximum(boolean countIsMaximumParam)
           Set whether the number specified in setCountshould be a maximum string length, or the number of characters to prepend.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeadingCharacterFormat

public LeadingCharacterFormat()
Method Detail

format

public final java.lang.String format(java.lang.String hTMLText)

Takes the text provided and prepends the character defined in setCharacterthe number of times defined in setCount. If you specified this is a maximum ( setMaximum(true)), then only the rightmost count of characters are returned.

Specified by:
format in interface HTMLFormat
Parameters:
hTMLText - Refer to HTMLFormat.format(java.lang.String).
Returns:
Refer to HTMLFormat.format(java.lang.String).

getCountIsMaximum

public final boolean getCountIsMaximum()

Get whether the number specified in setCountshould be a maximum string length, or the number of characters to prepend.

Returns:
false if the count from setCount represents a total number of characters to prepend, or true- default setting - represents a maximum string length for the whole string returned in format(java.lang.String).


setCountIsMaximum

public final void setCountIsMaximum(boolean countIsMaximumParam)

Set whether the number specified in setCountshould be a maximum string length, or the number of characters to prepend.

Parameters:
countIsMaximumParam - set to false if the count from setCountrepresents a total number of characters to prepend, or true- default setting - represents a maximum string length for the whole string returned in format.


getCharacter

public final char getCharacter()

This character will be prepended to the string.

Returns:
the current value of the character which will prepended.

setCharacter

public final void setCharacter(char characterParam)

This character will be prepended to the string.

Parameters:
characterParam - the new value of the character which will be prepended.

getCount

public final int getCount()

The number of times the character will be prepended.

Returns:
the current value of count.

setCount

public final void setCount(int countParam)

The number of times the character will be prepended.

Parameters:
countParam - the new value of count.


Copyright © 2001-2005 ivata limited. All Rights Reserved.