org.jbind.xml.base
Interface IRange

All Known Implementing Classes:
Range

public interface IRange

Represents a range of possible occurences of elements.


Method Summary
 boolean compareMaxOccurs(int anInt)
          Checks if the maxOccurs is equal to the specified integer.
 int getMaxOccurs()
          Gets the maximum number of occurences.
 int getMinOccurs()
          Gets the minimum number of occurences.
 boolean isOne()
          Checks if the range has a minOccurs and a maxOccurs of 1.
 boolean isUnbounded()
          Checks if the range is unbounded, i.e.
 boolean isZero()
          Checks if the range has minOccurs and a maxOccurs of 0.
 

Method Detail

getMinOccurs

public int getMinOccurs()
Gets the minimum number of occurences.

Returns:
The minimum number of occurences.

getMaxOccurs

public int getMaxOccurs()
Gets the maximum number of occurences. This method must only be called if the range is not unbounded.

Returns:
The maximum number of occurences.

isUnbounded

public boolean isUnbounded()
Checks if the range is unbounded, i.e. has no upper bound.

Returns:
Returns true iff the range is unbounded.

compareMaxOccurs

public boolean compareMaxOccurs(int anInt)
Checks if the maxOccurs is equal to the specified integer. This check must not be performed using the getMaxOccurs method directly because that method must only be called if the range is not unbounded.

Returns:
Returns true iff the maxOccurs is equal to the specified integer.

isZero

public boolean isZero()
Checks if the range has minOccurs and a maxOccurs of 0.

Returns:
Returns true iff minOccurs and maxOccurs are 0.

isOne

public boolean isOne()
Checks if the range has a minOccurs and a maxOccurs of 1.

Returns:
Returns true iff the minOccurs and the maxOccurs are 1.