Package org.jibx.schema.types
Class Count
- java.lang.Object
-
- org.jibx.schema.types.Count
-
public class Count extends Object
Repetition count in a schema definition.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description static CountCOUNT_ONEPredefined count of '1'.static CountCOUNT_UNBOUNDEDPredefined count of 'unbounded'.static CountCOUNT_ZEROPredefined count of '0'.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CountgetBoundedCount(String value)Deserializer method for bounded values.intgetCount()Get count value.static CountgetCount(String value)Deserializer method.static booleanisCountEqual(int value, Count count)Check if a count attribute is equal to a specified value.booleanisEqual(int value)Check for count equal to a particular value.booleanisGreaterThan(int value)Check for count greater than a particular value.booleanisUnbounded()Check for unbounded count.StringtoString()Conversion to text form.
-
-
-
Method Detail
-
getCount
public int getCount()
Get count value. This method throws an exception if used with an unbounded value, so always tryisUnbounded()first.- Returns:
- count
-
isUnbounded
public boolean isUnbounded()
Check for unbounded count.- Returns:
- unbounded flag
-
isEqual
public boolean isEqual(int value)
Check for count equal to a particular value. This is a convenience method which avoids the need to separately check unbounded and then compare the count.- Parameters:
value- to check- Returns:
- equal flag
-
isGreaterThan
public boolean isGreaterThan(int value)
Check for count greater than a particular value. This is a convenience method which avoids the need to separately check unbounded and then compare the count.- Parameters:
value- to check- Returns:
- greater than flag
-
getBoundedCount
public static Count getBoundedCount(String value) throws org.jibx.runtime.JiBXException
Deserializer method for bounded values.- Parameters:
value- text representation- Returns:
- instance of class
- Throws:
org.jibx.runtime.JiBXException- on conversion error
-
getCount
public static Count getCount(String value) throws org.jibx.runtime.JiBXException
Deserializer method.- Parameters:
value- text representation- Returns:
- instance of class (
nullif none) - Throws:
org.jibx.runtime.JiBXException- on conversion error
-
isCountEqual
public static boolean isCountEqual(int value, Count count)Check if a count attribute is equal to a specified value. If the count isnull, the value is taken as '1'.- Parameters:
value- to checkcount- times- Returns:
trueif value equal,falseif not
-
-