public static class Section.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Section.Builder |
appendRange(int size)
Append a new Range(0,size-1)
|
Section.Builder |
appendRange(int first,
int last)
Append a new Range(first, last) to the Section
|
Section.Builder |
appendRange(int first,
int last,
int stride)
Append a new Range(first,last,stride) to the Section.
|
Section.Builder |
appendRange(Range range)
Append a Range to the Section
|
Section.Builder |
appendRange(java.lang.String name,
int first,
int last,
int stride)
Append a new Range(name,first,last,stride) to the Section
|
Section.Builder |
appendRangeAll()
Append a Range to the Section meaning "all"
|
Section.Builder |
appendRanges(int[] shape)
Create Section from a shape array, assumes 0 origin.
|
Section.Builder |
appendRanges(java.util.List<Range> ranges)
Append Ranges to the Section
|
Section |
build() |
Section.Builder |
insertRange(int index,
Range r)
Insert a range at the specified index in the list.
|
Section.Builder |
removeFirst(int n)
Remove the first n Ranges, n <= number of ranges.
|
Section.Builder |
removeLast()
Remove the last range, if it exists.
|
Section.Builder |
removeRange(int index)
Remove a range at the specified index in the list.
|
Section.Builder |
removeVlen()
Remove the last range, if it exists and is a Vlen.
|
Section.Builder |
replaceRange(int index,
Range r)
Replace a range at the specified index in the list.
|
Section.Builder |
setRange(int index,
Range r)
Set the range at the specified index in the list, previous Range is discarded
|
public Section.Builder appendRange(int size)
public Section.Builder appendRange(int first, int last) throws InvalidRangeException
first - starting indexlast - last index, inclusive. If last < 0, then append a VLEN Range.InvalidRangeExceptionpublic Section.Builder appendRange(int first, int last, int stride) throws InvalidRangeException
first - starting indexlast - last index, inclusivestride - strideInvalidRangeExceptionpublic Section.Builder appendRange(Range range)
range - not null.public Section.Builder appendRange(java.lang.String name, int first, int last, int stride) throws InvalidRangeException
name - name of Rangefirst - starting indexlast - last index, inclusivestride - strideInvalidRangeExceptionpublic Section.Builder appendRangeAll()
public Section.Builder appendRanges(int[] shape)
shape - array of lengths for each Range. 0 = EMPTY, < 0 = VLENpublic Section.Builder appendRanges(java.util.List<Range> ranges)
ranges - not null.public Section build()
public Section.Builder insertRange(int index, Range r)
index - insert here in the list, existing ranges at or after this index get shifted by oner - insert this Rangepublic Section.Builder removeFirst(int n)
public Section.Builder removeLast()
public Section.Builder removeRange(int index)
index - remove here in the list, existing ranges after this index get shifted by onepublic Section.Builder removeVlen()
public Section.Builder replaceRange(int index, Range r)
index - replace here in the list.r - use this Rangejava.lang.IndexOutOfBoundsException - if bad indexpublic Section.Builder setRange(int index, Range r)
index - list index, must be in interval [0,size).r - insert this Range