wt.util.version
Class ReleaseIdRange

java.lang.Object
  extended bywt.util.version.ReleaseIdRange

public class ReleaseIdRange
extends Object

ReleaseIdRange contains a Range and provides methods for creating the various combinations of range types.

See Also:
wt.util.Range

Field Summary
private  String assemblyId_
           
private  int cachedHashCode_
           
static String EXCLUSIVE_FROM_RANGE_ATTRIBUTE_NAME
           
static String EXCLUSIVE_TO_RANGE_ATTRIBUTE_NAME
           
static String INCLUSIVE_FROM_RANGE_ATTRIBUTE_NAME
           
static String INCLUSIVE_TO_RANGE_ATTRIBUTE_NAME
           
private  boolean needToComputeHashCode_
           
private  Range range_
           
static String VERSION_RANGE_ELEMENT_NAME
           
 
Constructor Summary
private ReleaseIdRange(Range range)
          Constructs the ReleaseIdRange from a Range constructed from a low and high ReleaseId.
 
Method Summary
 Element asDom(Document dom_factory)
          Produce a DOM fragment that looks like:
 boolean contains(ReleaseId version)
          Returns true if the given version is contained in the range for this ReleaseId.
static ReleaseIdRange createFrom(Element version_range_element)
          Create a ReleaseIdRange from a DOM fragment that looks like:
static ReleaseIdRange createFrom(ReleaseId lower, boolean lower_inclusive, ReleaseId upper, boolean upper_inclusive)
          A generic factory method that allows you to provide a null upper or lower version (not both) and allows your to parameterize the inclusiveness of each end point.
 boolean equals(Object other)
           
 ReleaseId getLowerBound()
          The version that is the lower boundary point.
 ReleaseId getUpperBound()
          The version that is the upper boundary point.
 int hashCode()
           
 boolean isLowerBoundInclusive()
          Whether or not the range's lower bound is inclusive.
 boolean isUpperBoundInclusive()
          Whether or not the range's upper bound is inclusive.
static ReleaseIdRange newExcludeLowExcludeHigh(ReleaseId low, ReleaseId high)
          Conceptually, using numbers: (low, high)
static ReleaseIdRange newExcludeLowIncludeHigh(ReleaseId low, ReleaseId high)
          Conceptually, using numbers: (low, high]
static ReleaseIdRange newExcludeLowUnboundedHigh(ReleaseId low)
          Conceptually, using numbers: (low, infinity)
static ReleaseIdRange newIncludeLowExcludeHigh(ReleaseId low, ReleaseId high)
          Conceptually, using numbers: [low, high)
static ReleaseIdRange newIncludeLowIncludeHigh(ReleaseId low, ReleaseId high)
          Conceptually, using numbers: [low, high]
static ReleaseIdRange newIncludeLowUnboundedHigh(ReleaseId low)
          Conceptually, using numbers: [low, infinity)
static ReleaseIdRange newUnboundedLowExcludeHigh(ReleaseId high)
          Conceptually, using numbers: (-infinity, high)
static ReleaseIdRange newUnboundedLowIncludeHigh(ReleaseId high)
          Conceptually, using numbers: (-infinity, high]
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION_RANGE_ELEMENT_NAME

public static final String VERSION_RANGE_ELEMENT_NAME
See Also:
Constant Field Values

INCLUSIVE_FROM_RANGE_ATTRIBUTE_NAME

public static final String INCLUSIVE_FROM_RANGE_ATTRIBUTE_NAME
See Also:
Constant Field Values

EXCLUSIVE_FROM_RANGE_ATTRIBUTE_NAME

public static final String EXCLUSIVE_FROM_RANGE_ATTRIBUTE_NAME
See Also:
Constant Field Values

INCLUSIVE_TO_RANGE_ATTRIBUTE_NAME

public static final String INCLUSIVE_TO_RANGE_ATTRIBUTE_NAME
See Also:
Constant Field Values

EXCLUSIVE_TO_RANGE_ATTRIBUTE_NAME

public static final String EXCLUSIVE_TO_RANGE_ATTRIBUTE_NAME
See Also:
Constant Field Values

assemblyId_

private String assemblyId_

range_

private Range range_

needToComputeHashCode_

private boolean needToComputeHashCode_

cachedHashCode_

private int cachedHashCode_
Constructor Detail

ReleaseIdRange

private ReleaseIdRange(Range range)
Constructs the ReleaseIdRange from a Range constructed from a low and high ReleaseId.

Method Detail

createFrom

public static ReleaseIdRange createFrom(ReleaseId lower,
                                        boolean lower_inclusive,
                                        ReleaseId upper,
                                        boolean upper_inclusive)
                                 throws RangeException
A generic factory method that allows you to provide a null upper or lower version (not both) and allows your to parameterize the inclusiveness of each end point.

Throws:
RangeException

newIncludeLowIncludeHigh

public static ReleaseIdRange newIncludeLowIncludeHigh(ReleaseId low,
                                                      ReleaseId high)
                                               throws RangeException,
                                                      ReleaseIdException
Conceptually, using numbers: [low, high]

Throws:
RangeException
ReleaseIdException

newIncludeLowExcludeHigh

public static ReleaseIdRange newIncludeLowExcludeHigh(ReleaseId low,
                                                      ReleaseId high)
                                               throws RangeException
Conceptually, using numbers: [low, high)

Throws:
RangeException

newExcludeLowIncludeHigh

public static ReleaseIdRange newExcludeLowIncludeHigh(ReleaseId low,
                                                      ReleaseId high)
                                               throws RangeException
Conceptually, using numbers: (low, high]

Throws:
RangeException

newExcludeLowExcludeHigh

public static ReleaseIdRange newExcludeLowExcludeHigh(ReleaseId low,
                                                      ReleaseId high)
                                               throws RangeException
Conceptually, using numbers: (low, high)

Throws:
RangeException

newIncludeLowUnboundedHigh

public static ReleaseIdRange newIncludeLowUnboundedHigh(ReleaseId low)
                                                 throws RangeException
Conceptually, using numbers: [low, infinity)

Throws:
RangeException

newExcludeLowUnboundedHigh

public static ReleaseIdRange newExcludeLowUnboundedHigh(ReleaseId low)
                                                 throws RangeException
Conceptually, using numbers: (low, infinity)

Throws:
RangeException

newUnboundedLowIncludeHigh

public static ReleaseIdRange newUnboundedLowIncludeHigh(ReleaseId high)
                                                 throws RangeException
Conceptually, using numbers: (-infinity, high]

Throws:
RangeException

newUnboundedLowExcludeHigh

public static ReleaseIdRange newUnboundedLowExcludeHigh(ReleaseId high)
                                                 throws RangeException
Conceptually, using numbers: (-infinity, high)

Throws:
RangeException

contains

public boolean contains(ReleaseId version)
Returns true if the given version is contained in the range for this ReleaseId.


asDom

public Element asDom(Document dom_factory)
Produce a DOM fragment that looks like:
    <ReleaseIdRange from="a.b.c" to="d.e.f"/>
 
If the range is exclusive on either end, the from and to, change to exFrom and exTo respectively. If the range is unbounded on one end, the appropriate from or to attribute will be absent.


createFrom

public static ReleaseIdRange createFrom(Element version_range_element)
                                 throws RangeException,
                                        ReleaseIdException
Create a ReleaseIdRange from a DOM fragment that looks like:
    <ReleaseIdRange from="a.b.c" to="d.e.f"/>
 
The end points are inclusive as specified above. Changing the from or to attributes to exFrom or exTo respectively will make the end points exclusive. To define an unbounded range (in one direction only), ommit the appropriate from/exFrom or to/exTo attribute.

Throws:
RangeException
ReleaseIdException

getLowerBound

public ReleaseId getLowerBound()
The version that is the lower boundary point.

Returns:
null if the range is not bounded below

isLowerBoundInclusive

public boolean isLowerBoundInclusive()
Whether or not the range's lower bound is inclusive.

Returns:
true if the lower bound exists and is inclusive

getUpperBound

public ReleaseId getUpperBound()
The version that is the upper boundary point.

Returns:
null if the range is not bounded above

isUpperBoundInclusive

public boolean isUpperBoundInclusive()
Whether or not the range's upper bound is inclusive.

Returns:
true if the upper bound exists and is inclusive

toString

public String toString()

equals

public boolean equals(Object other)

hashCode

public int hashCode()