Package ucar.ma2
Class Section.Builder
java.lang.Object
ucar.ma2.Section.Builder
- Enclosing class:
- Section
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendRange(int size) Append a new Range(0,size-1)appendRange(int first, int last) Append a new Range(first, last) to the SectionappendRange(int first, int last, int stride) Append a new Range(first,last,stride) to the Section.appendRange(String name, int first, int last, int stride) Append a new Range(name,first,last,stride) to the SectionappendRange(Range range) Append a Range to the SectionAppend a Range to the Section meaning "all"appendRanges(int[] shape) Create Section from a shape array, assumes 0 origin.appendRanges(List<Range> ranges) Append Ranges to the Sectionbuild()insertRange(int index, Range r) Insert a range at the specified index in the list.removeFirst(int n) Remove the first n Ranges, n <= number of ranges.Remove the last range, if it exists.removeRange(int index) Remove a range at the specified index in the list.Remove the last range, if it exists and is a Vlen.replaceRange(int index, Range r) Replace a range at the specified index in the list.Set the range at the specified index in the list, previous Range is discarded
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
appendRangeAll
Append a Range to the Section meaning "all" -
appendRange
Append a Range to the Section- Parameters:
range- not null.
-
appendRange
Append a new Range(0,size-1) -
appendRange
Append a new Range(first, last) to the Section- Parameters:
first- starting indexlast- last index, inclusive. If last < 0, then append a VLEN Range.- Throws:
InvalidRangeException
-
appendRange
Append a new Range(first,last,stride) to the Section.- Parameters:
first- starting indexlast- last index, inclusivestride- stride- Throws:
InvalidRangeException
-
appendRange
public Section.Builder appendRange(String name, int first, int last, int stride) throws InvalidRangeException Append a new Range(name,first,last,stride) to the Section- Parameters:
name- name of Rangefirst- starting indexlast- last index, inclusivestride- stride- Throws:
InvalidRangeException
-
appendRanges
Append Ranges to the Section- Parameters:
ranges- not null.
-
appendRanges
Create Section from a shape array, assumes 0 origin.- Parameters:
shape- array of lengths for each Range. 0 = EMPTY, < 0 = VLEN
-
insertRange
Insert a range at the specified index in the list.- Parameters:
index- insert here in the list, existing ranges at or after this index get shifted by oner- insert this Range
-
removeRange
Remove a range at the specified index in the list.- Parameters:
index- remove here in the list, existing ranges after this index get shifted by one
-
replaceRange
Replace a range at the specified index in the list.- Parameters:
index- replace here in the list.r- use this Range- Returns:
- this
- Throws:
IndexOutOfBoundsException- if bad index
-
setRange
Set the range at the specified index in the list, previous Range is discarded- Parameters:
index- list index, must be in interval [0,size).r- insert this Range
-
removeLast
Remove the last range, if it exists. -
removeFirst
Remove the first n Ranges, n <= number of ranges. -
removeVlen
Remove the last range, if it exists and is a Vlen. -
build
-