Groovy – Lists get()
Returns the element at the specified position in this list. Syntax Object get(int index) Parameters Index – The index at which the value needs to be returned. Return Value The…
Returns the element at the specified position in this list. Syntax Object get(int index) Parameters Index – The index at which the value needs to be returned. Return Value The…
Returns true if this List contains the specified value. Syntax boolean contains(Object value) Parameters Value − The value to find in the list. Return Value True or false depending on if…
Append the new value to the end of this List. This method has 2 different variants. boolean add(Object value) − Append the new value to the end of this List. Syntax…
The List is a structure used to store a collection of data items. In Groovy, the List holds a sequence of object references. Object references in a List occupy a…
Returns a view of the portion of this Range between the specified fromIndex, inclusive, and toIndex, exclusive Syntax List subList(int fromIndex, int toIndex) Parameters fromIndex – Starting index of the…
Returns the number of elements in this Range. Syntax int size() Parameters None Return Value Returns the size of the range. Following is an example of the usage of this…
Is this a reversed Range, iterating backward? Syntax boolean isReverse() Parameters None Return Value Boolean value of true or false on whether the range is reversed. Example Following is an…
Get the upper value of this Range. Syntax Comparable getTo() Parameters None Return Value The upper value of the range. Example Following is an example of the usage of this…
Get the lower value of this Range. Syntax Comparable getFrom() Parameters None Return Value The lower value of the range. Example Following is an example of the usage of this…
Returns the element at the specified position in this Range. Syntax Object get(int index) Parameters Index – The index value to get from the range. Return Value The range value…