All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.spardat.enterprise.fmt.ASelectionFmt Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
package at.spardat.enterprise.fmt;

/** 
 * The text is interpreted as number of selected items 
 *
 */
public class ASelectionFmt extends IFmt{
	
    private static final int            MAX_LEN = 10;
    
	public String parse(String external) throws AParseException {
		if ("0".equals(external))
			throw new FmtParseException ("NotEmpty");
		return external;
	}

	public String format(String internal) {
		return internal;
	}

	public int maxLenOfExternal() {
		return MAX_LEN;
	}

	public boolean isLegalExternalChar(char aChar) {
		return '0' <= aChar && aChar <= '9';
	}

	public boolean isLegalInternal(String internal) {
		try {
			Integer.parseInt(internal);
			return true;
		}catch(NumberFormatException e) {
			return false;
		}
	}

	public boolean isOneWay() {
		return false;
	}

	public boolean mayBeAppliedTo(byte type) {
		return false;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy