View Javadoc

1   package ca.uhn.hl7v2.model.primitive;
2   
3   import ca.uhn.hl7v2.model.AbstractPrimitive;
4   import ca.uhn.hl7v2.model.Message;
5   
6   public abstract class AbstractNumericPrimitive extends AbstractPrimitive {
7   
8   	public AbstractNumericPrimitive(Message theMessage) {
9   		super(theMessage);
10  	}
11  
12  	/**
13  	 * Returns true of the string contains only numbers
14  	 */
15  	public static boolean isInteger(String theString) {
16  		for (int i = 0; i < theString.length(); i++) {
17  			if (Character.isDigit(theString.charAt(i)) == false) {
18  				return false;
19  			}
20  		}
21  		return true;
22  	}
23  	
24  }