Package ucar.nc2
Class Dimensions
java.lang.Object
ucar.nc2.Dimensions
Static helper methods for Dimension.
- Since:
- 10/3/2019.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA Function that finds a Dimension by name. -
Method Summary
Modifier and TypeMethodDescriptionstatic longGet the total number of elements the dimensions represent.static com.google.common.collect.ImmutableList<Dimension>Get list of Dimensions, including parent Structure(s), if any.static com.google.common.collect.ImmutableList<Dimension>makeDimensionsAnon(int[] shape) Make a list of private dimensions from an array of lengthsstatic com.google.common.collect.ImmutableList<Dimension>makeDimensionsList(Dimensions.FindDimensionByName finder, String dimString) Make a list of Dimensions from a list of names.static StringmakeDimensionsString(List<Dimension> dimensions) Make a space-delineated String from a list of Dimension names, inverse of makeDimensionsList().static Section.BuildermakeSectionFromDimensions(Iterable<Dimension> dimensions) Make a ucar.ma2.Section.Builder from an ordered set of Dimension objects.static int[]Make an array of Dimension lengths.
-
Method Details
-
makeSectionFromDimensions
Make a ucar.ma2.Section.Builder from an ordered set of Dimension objects. -
getSize
Get the total number of elements the dimensions represent. -
makeShape
Make an array of Dimension lengths. -
makeDimensionsString
Make a space-delineated String from a list of Dimension names, inverse of makeDimensionsList(). -
makeDimensionsList
public static com.google.common.collect.ImmutableList<Dimension> makeDimensionsList(Dimensions.FindDimensionByName finder, String dimString) throws IllegalArgumentException Make a list of Dimensions from a list of names.- Parameters:
finder- interface to find a Dimension by name.dimString- space separated list of dimension names.- Returns:
- equivalent list of Dimension objects.
- Throws:
IllegalArgumentException- if cant find or parse the name.
-
makeDimensionsAnon
Make a list of private dimensions from an array of lengths -
makeDimensionsAll
Get list of Dimensions, including parent Structure(s), if any.- Returns:
- array of Dimension, rank of v plus all parent Structures.
-