Package com.sun.tools.xjc.model
Class Multiplicity
java.lang.Object
com.sun.tools.xjc.model.Multiplicity
represents a possible number of occurence.
Usually, denoted by a pair of integers like (1,1) or (5,10).
A special value "unbounded" is allowed as the upper bound.
For example, (0,unbounded) corresponds to the '*' occurence of DTD. (0,1) corresponds to the '?' occurence of DTD.
- Author:
- Kohsuke KAWAGUCHI
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal BigIntegerfinal BigIntegerstatic final Multiplicitythe constant representing the (1,1) multiplicity.static final Multiplicitythe constant representing the (0,1) multiplicity.static final Multiplicitythe constant representing the (1,unbounded) multiplicity.static final Multiplicitythe constant representing the (0,unbounded) multiplicity.static final Multiplicitythe constant representing the (0,0) multiplicity. -
Method Summary
Modifier and TypeMethodDescriptionstatic Multiplicitychoice(Multiplicity lhs, Multiplicity rhs) static Multiplicitystatic Multiplicitycreate(BigInteger min, BigInteger max) booleanReturns the string representation of the 'max' property.static Multiplicitygroup(Multiplicity lhs, Multiplicity rhs) inthashCode()booleanincludes(Multiplicity rhs) Returns true if the multiplicity represented by this object completely includes the multiplicity represented by the other object.booleanreturns true if the multiplicity is (0,1) or (1,1).booleanreturns true if the multiplicity is (0,1)booleanisUnique()returns true if the multiplicity is (1,1).booleanisZero()returns true if the multiplicity is (0,0).static Multiplicitymultiply(Multiplicity lhs, Multiplicity rhs) static MultiplicitytoString()gets the string representation.
-
Field Details
-
min
-
max
-
ZERO
the constant representing the (0,0) multiplicity. -
ONE
the constant representing the (1,1) multiplicity. -
OPTIONAL
the constant representing the (0,1) multiplicity. -
STAR
the constant representing the (0,unbounded) multiplicity. -
PLUS
the constant representing the (1,unbounded) multiplicity.
-
-
Method Details
-
create
-
create
-
equals
-
hashCode
public int hashCode() -
isUnique
public boolean isUnique()returns true if the multiplicity is (1,1). -
isOptional
public boolean isOptional()returns true if the multiplicity is (0,1) -
isAtMostOnce
public boolean isAtMostOnce()returns true if the multiplicity is (0,1) or (1,1). -
isZero
public boolean isZero()returns true if the multiplicity is (0,0). -
includes
Returns true if the multiplicity represented by this object completely includes the multiplicity represented by the other object. For example, we say [1,3] includes [1,2] but [2,4] doesn't include [1,3]. -
getMaxString
Returns the string representation of the 'max' property. Either a number or a token "unbounded". -
toString
gets the string representation. mainly debug purpose. -
choice
-
group
-
multiply
-
oneOrMore
-
makeOptional
-
makeRepeated
-