LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.text
Class LyJFormat.Interval

java.lang.Object
  extended by leon.view.win.swing.text.LyJFormat.Interval
Enclosing class:
LyJFormat

public class LyJFormat.Interval
extends java.lang.Object

This class implements a representation of an interval with min and max values.
An Interval can store a String representing the value that is edited in the textField. An Interval knows where it begins and ends in its corresponding textField.


Constructor Summary
LyJFormat.Interval(int minimum, int maximum)
          Constructor.
 
Method Summary
 void clear()
          Resets the content.
 java.lang.String getContent()
          Gets the interval content.
 java.lang.String getCurrentPossibleValue()
          Gets the current possible value between the min and the max.
 java.lang.String getEditedDisplayableString()
          Gets the value to display in non-edition mode.
 java.lang.String getEditingDisplayableString()
          Gets the value to display during edition processus.
 int getEndOffset()
          Gets the end offset.
 int getIntValue()
          Gets the value of this interval as an int.
 int getMaxCharCount()
          Gets the maximum number of characters needed to display the value.
 java.lang.String getMaxCompletedString()
          Gets a copy of the content where the EMPTY_CHAR is replaced by the maximum possible value ('9').
 int getMaximum()
          Gets the maximum of the interval.
 java.lang.String getMinCompletedString()
          Gets a copy of the content where the EMPTY_CHAR is replaced by the minimum possible value ('0').
 int getMinimum()
          Gets the minimum of the interval.
 int getStartOffset()
          Gets the start offset.
 boolean isEmpty()
          Indicates if the interval is empty or not.
 void replaceChar(int offset, char c)
          Replaces the char found at position offset in this interval by the given character.
 void setIntValue(int value)
          Sets the int value of this interval.
 void setOffset(int offset)
          Sets the start and end offsets.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LyJFormat.Interval

public LyJFormat.Interval(int minimum,
                          int maximum)
Constructor. Stes the minimum and the maximum with the given values then reset the content.

Parameters:
minimum - the minimum of the interval
maximum - the maximum of the interval
Method Detail

getMinimum

public int getMinimum()
Gets the minimum of the interval.

Returns:
the min value

getMaximum

public int getMaximum()
Gets the maximum of the interval.

Returns:
the max value

getMaxCharCount

public int getMaxCharCount()
Gets the maximum number of characters needed to display the value.

Returns:
the max number of characters

setOffset

public void setOffset(int offset)
Sets the start and end offsets.
end offset = start offset + max number of character - 1.

Parameters:
offset - the start offset

getStartOffset

public int getStartOffset()
Gets the start offset.

Returns:
the start offset

getEndOffset

public int getEndOffset()
Gets the end offset.

Returns:
the end offset

replaceChar

public void replaceChar(int offset,
                        char c)
Replaces the char found at position offset in this interval by the given character.

Parameters:
offset - the offset
c - the replacment character

isEmpty

public boolean isEmpty()
Indicates if the interval is empty or not.

Returns:
true if this Interval contains no value, false otherwise

getContent

public java.lang.String getContent()
Gets the interval content.

Returns:
the interval content

getEditingDisplayableString

public java.lang.String getEditingDisplayableString()
Gets the value to display during edition processus.

Returns:
the content of the interval

getEditedDisplayableString

public java.lang.String getEditedDisplayableString()
Gets the value to display in non-edition mode.

Returns:
the value

getMaxCompletedString

public java.lang.String getMaxCompletedString()
Gets a copy of the content where the EMPTY_CHAR is replaced by the maximum possible value ('9').

Returns:
the built string

getMinCompletedString

public java.lang.String getMinCompletedString()
Gets a copy of the content where the EMPTY_CHAR is replaced by the minimum possible value ('0').

Returns:
the built string

getIntValue

public int getIntValue()
Gets the value of this interval as an int.

Returns:
the value of this interval as an int
See Also:
setIntValue(int)

setIntValue

public void setIntValue(int value)
Sets the int value of this interval.

Parameters:
value - the value to set
See Also:
getIntValue()

getCurrentPossibleValue

public java.lang.String getCurrentPossibleValue()
Gets the current possible value between the min and the max.

Returns:
always ""

clear

public void clear()
Resets the content.


(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com