Top Description Fields Constructors Methods
net.fortuna.ical4j.model

public Class NumberList

extends ArrayList<Integer>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
net.fortuna.ical4j.util.Numbers, .RegEx, java.io.Serializable, java.time.temporal.ValueRange, java.util.*, java.util.stream.Collectors

$Id$ [29-May-2004] Defines a list of numbers.
Author
Ben Fortuna

Field Summary

Modifier and TypeField and Description
private final boolean
private final ValueRange
private static final long

Constructor Summary

AccessConstructor and Description
public
NumberList()

Default constructor.

public
NumberList(ValueRange
a range defining the lower and upper bounds of allowed values
valueRange
,
boolean
allow negative values, where abs(value) is within the specified range
allowsNegativeValues
)

Construct a number list restricted by the specified ValueRange.

public
NumberList(int
the minimum allowable value
minValue
,
int
the maximum allowable value
maxValue
,
boolean
indicates whether negative values are allowed
allowsNegativeValues
)

Constructor with limits.

public
NumberList(final String
a string representation of a number list
aString
)

Constructor.

public
NumberList(final String
a string representation of a list of values
aString
,
ValueRange
a range defining the lower and upper bounds of allowed values
valueRange
,
boolean
allow negative values, where abs(value) is within the specified range
allowsNegativeValues
)

Construct a number list restricted by the specified ValueRange.

public
NumberList(Collection<Integer> values, ValueRange valueRange, boolean allowsNegativeValues)

public
NumberList(final String
a string representation of a number list
aString
,
int
the minimum allowable value
minValue
,
int
the maximum allowable value
maxValue
,
boolean
indicates whether negative values are allowed
allowsNegativeValues
)

Method Summary

Modifier and TypeMethod and Description
public final boolean

Returns:

true if the number was added, otherwise false
add
(final Integer
a number to add to the list
aNumber
)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this list.

public boolean
addAll(Collection<? extends Integer>
collection containing elements to be added to this list
c
)

Overrides java.util.ArrayList.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator.

public static NumberList
parse(String numberString)

public final String
toString()

Overrides java.util.AbstractCollection.toString.

Returns a string representation of this collection.

public static String
Inherited from java.util.ArrayList:
addaddAlladdFirstaddLastclearclonecontainsensureCapacityequalsforEachgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveAllremoveFirstremoveIfremoveLastremoveRangereplaceAllretainAllsetsizesortspliteratorsubListtoArraytoArraytrimToSize

Field Detail

allowsNegativeValuesback to summary
private final boolean allowsNegativeValues
rangeback to summary
private final ValueRange range
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.ArrayList.serialVersionUID.

Constructor Detail

NumberListback to summary
public NumberList()

Default constructor.

NumberListback to summary
public NumberList(ValueRange valueRange, boolean allowsNegativeValues)

Construct a number list restricted by the specified ValueRange.

Parameters
valueRange:ValueRange

a range defining the lower and upper bounds of allowed values

allowsNegativeValues:boolean

allow negative values, where abs(value) is within the specified range

NumberListback to summary
public NumberList(int minValue, int maxValue, boolean allowsNegativeValues)

Constructor with limits.

Parameters
minValue:int

the minimum allowable value

maxValue:int

the maximum allowable value

allowsNegativeValues:boolean

indicates whether negative values are allowed

Annotations
@Deprecated
NumberListback to summary
public NumberList(final String aString)

Constructor.

Parameters
aString:String

a string representation of a number list

NumberListback to summary
public NumberList(final String aString, ValueRange valueRange, boolean allowsNegativeValues)

Construct a number list restricted by the specified ValueRange.

Parameters
aString:String

a string representation of a list of values

valueRange:ValueRange

a range defining the lower and upper bounds of allowed values

allowsNegativeValues:boolean

allow negative values, where abs(value) is within the specified range

NumberListback to summary
public NumberList(Collection<Integer> values, ValueRange valueRange, boolean allowsNegativeValues)
NumberListback to summary
public NumberList(final String aString, int minValue, int maxValue, boolean allowsNegativeValues)
Parameters
aString:String

a string representation of a number list

minValue:int

the minimum allowable value

maxValue:int

the maximum allowable value

allowsNegativeValues:boolean

indicates whether negative values are allowed

Annotations
@Deprecated

Method Detail

addback to summary
public final boolean add(final Integer aNumber)

Overrides java.util.ArrayList.add.

Implements java.util.List.add, java.util.Collection.add.

Doc from java.util.ArrayList.add.

Appends the specified element to the end of this list.

Parameters
aNumber:Integer

a number to add to the list

Returns:boolean

true if the number was added, otherwise false

Annotations
@Override
addAllback to summary
public boolean addAll(Collection<? extends Integer> c)

Overrides java.util.ArrayList.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Doc from java.util.ArrayList.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this list, and this list is nonempty.)

Parameters
c:Collection<? extends Integer>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
parseback to summary
public static NumberList parse(String numberString)
toStringback to summary
public final String toString()

Overrides java.util.AbstractCollection.toString.

Doc from java.util.AbstractCollection.toString.

Returns a string representation of this collection. The string representation consists of a list of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings as by String#valueOf(Object).

Returns:String

a string representation of this collection

Annotations
@Override
toStringback to summary
public static String toString(List<Integer> list)