Microsoft SDK for Java

IntRanges Class Constructors

The IntRanges Class contains the following constructors:

IntRanges()
IntRanges(String str)
IntRanges(String str, String delims)

IntRanges()

Constructs an empty set of ranges as an IntArrayOutputStream object.

Syntax

public IntRanges();

IntRanges(String str)

Constructs a set of ranges from the given string.

Syntax

public IntRanges(String str);

Exceptions

Throws IllegalArgumentException if the string to be parsed is invalid.

Parameters

str A string containing ranges of integers, where the bounds of each range are separated by a hyphen (-), and separate ranges are delimited by commas. A range of a single integer can be entered by including just the single integer, separated by delimiters. For example: 1-5,9-11,44,13-120.

IntRanges(String str, String delims)

Constructs a set of ranges from the given string with specified delimiters.

Syntax

public IntRanges(String str, String delims);

Exceptions

Throws IllegalArgumentException if the string to be parsed is invalid.

Parameters

str A string containing ranges of integers, where the bounds of each range are separated by a hyphen (-). A range of a single integer can be entered by including just the single integer, separated by delimiters.
delims The character or characters that separate the ranges.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.