1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| /**
* Interface implemented by classes that format field values.
* @author Lyria
*/
public interface LyFormatterInterface
{
String __VERSION = "$Id: LyFormatterInterface.java,v 6.5 2007/12/05 09:01:13 jls Exp $";
/**
* Method to format a value to an edition string with the given unit.
* @param fieldInfo the fieldInfo for which a value is formatted
* @param value the value to format
* @param unit the destination unit of the string value
* @return The edition string corresponding to the given value and unit.
*/
String toString(LyFieldInfo fieldInfo, Object value, LyUnit unit);
/**
* Method to format a value to a displayable string with the given unit.
* @param fieldInfo the fieldInfo for which a value is formatted
* @param value the value to format
* @param unit the destination unit of the string value
* @return The displayable string corresponding to the given value and unit.
*/
String toName(LyFieldInfo fieldInfo, Object value, LyUnit unit);
/**
* Method to format a value to a displayable short string with the given unit.
* @param fieldInfo the fieldInfo for which a value is formatted
* @param value the value to format
* @param unit the destination unit of the string value
* @return The short displayable string corresponding to the given value and unit.
*/
String toShortName(LyFieldInfo fieldInfo, Object value, LyUnit unit);
/**
* Method to parse a string value with a given unit.
* @param fieldInfo the fieldInfo for which the string value is parsed.
* @param value the string value to parse
* @param unit the unit of the string value
* @return The value corresponding to the given string and unit.
*/
Object parse(LyFieldInfo fieldInfo, String value, LyUnit unit);
} |
Partager