public class NodeJSVersionRange extends Object
versions.
A range has a left (lower) endpoint and a right (upper) endpoint. Each endpoint can be open (excluded from the set) or closed (included in the set).
NodeJSVersionRange objects are immutable.
| Modifier and Type | Field and Description |
|---|---|
static char |
LEFT_CLOSED
The left endpoint is closed and is included in the range.
|
static char |
LEFT_OPEN
The left endpoint is open and is excluded from the range.
|
static char |
RIGHT_CLOSED
The right endpoint is closed and is included in the range.
|
static char |
RIGHT_OPEN
The right endpoint is open and is excluded from the range.
|
| Constructor and Description |
|---|
NodeJSVersionRange(String range)
Creates a version range from the specified string.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object)
Compares this
VersionRange object to another object. |
NodeJSVersion |
getLeft()
Returns the left endpoint of this version range.
|
char |
getLeftType()
Returns the type of the left endpoint of this version range.
|
NodeJSVersion |
getRight()
Returns the right endpoint of this version range.
|
char |
getRightType()
Returns the type of the right endpoint of this version range.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
includes(NodeJSVersion version)
Returns whether this version range includes the specified version.
|
boolean |
isEmpty()
Returns whether this version range is empty.
|
String |
toString()
Returns the string representation of this version range.
|
public static final char LEFT_OPEN
The value of LEFT_OPEN is '('.
public static final char LEFT_CLOSED
The value of LEFT_CLOSED is '['.
public static final char RIGHT_OPEN
The value of RIGHT_OPEN is ')'.
public static final char RIGHT_CLOSED
The value of RIGHT_CLOSED is ']'.
public NodeJSVersionRange(String range)
Version range string grammar:
range ::= interval | atleast
interval ::= ( '[' | '(' ) left ',' right ( ']' | ')' )
left ::= version
right ::= version
atleast ::= version
range - String representation of the version range. The versions in
the range must contain no whitespace. Other whitespace in the
range string is ignored.IllegalArgumentException - If range is improperly formatted.public NodeJSVersion getLeft()
public NodeJSVersion getRight()
null which indicates the right
endpoint is Infinity.public char getLeftType()
LEFT_CLOSED if the left endpoint is closed or
LEFT_OPEN if the left endpoint is open.public char getRightType()
RIGHT_CLOSED if the right endpoint is closed or
RIGHT_OPEN if the right endpoint is open.public boolean includes(NodeJSVersion version)
version - The version to test for inclusion in this version range.true if the specified version is included in this version
range; false otherwise.public boolean isEmpty()
true if this version range is empty; false
otherwise.public String toString()
The format of the version range string will be a version string if the
right end point is Infinity (null) or an interval string.
public int hashCode()
Copyright © 2016–2017. All rights reserved.