Package ucar.nc2
Class Variable.Builder<T extends Variable.Builder<T>>
- java.lang.Object
-
- ucar.nc2.Variable.Builder<T>
-
- Direct Known Subclasses:
Structure.Builder,VariableDS.Builder
- Enclosing class:
- Variable
public abstract static class Variable.Builder<T extends Variable.Builder<T>> extends Object
A builder for Variables.
-
-
Field Summary
Fields Modifier and Type Field Description Variable.CachecacheDataTypedataTypeNetcdfFilencfileprotected Group.BuilderparentBuilderprotected Structure.Builder<?>parentStructureBuilderProxyReaderproxyReaderStringshortNameObjectspiObject
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Field Detail
-
shortName
public String shortName
-
dataType
public DataType dataType
-
ncfile
public NetcdfFile ncfile
-
parentBuilder
protected Group.Builder parentBuilder
-
parentStructureBuilder
protected Structure.Builder<?> parentStructureBuilder
-
spiObject
public Object spiObject
-
proxyReader
public ProxyReader proxyReader
-
cache
public Variable.Cache cache
-
-
Method Detail
-
self
protected abstract T self()
-
getAttributeContainer
public AttributeContainerMutable getAttributeContainer()
-
addDimensions
public T addDimensions(Collection<Dimension> dims)
-
replaceDimensionByName
public boolean replaceDimensionByName(Dimension dim)
Find the dimension with the same name as dim, and replace it with dim
-
setDimensionsByName
public T setDimensionsByName(String dimString)
Set dimensions by name. The parent group builder must be set.
-
getFirstDimensionName
@Nullable public String getFirstDimensionName()
-
getDimensionName
@Nullable public String getDimensionName(int index)
-
makeDimensionsString
public String makeDimensionsString()
-
setDimensionsAnonymous
public T setDimensionsAnonymous(int[] shape)
Set the dimensions using all anonymous (unshared) dimensions- Parameters:
shape- defines the dimension lengths. must be > 0, or -1 for VLEN- Throws:
RuntimeException- if any shape < 1 and not -1.
-
getDimensions
public com.google.common.collect.ImmutableList<Dimension> getDimensions()
-
getDimensionsAll
public com.google.common.collect.ImmutableSet<String> getDimensionsAll()
-
setIsScalar
public T setIsScalar()
-
getRank
public int getRank()
-
getEnumTypeName
public String getEnumTypeName()
-
getElementSize
public int getElementSize()
-
setElementSize
public T setElementSize(int elementSize)
-
setNcfile
public T setNcfile(NetcdfFile ncfile)
-
getFullName
public String getFullName()
-
setParentGroupBuilder
public T setParentGroupBuilder(Group.Builder parent)
-
getParentGroupBuilder
public Group.Builder getParentGroupBuilder()
-
getParentStructureBuilder
public Structure.Builder<?> getParentStructureBuilder()
-
setProxyReader
public T setProxyReader(ProxyReader proxy)
-
setAutoGen
public T setAutoGen(double start, double incr)
-
resetCache
public T resetCache()
-
setCaching
public T setCaching(boolean caching)
-
makeSliceBuilder
public Variable.Builder<?> makeSliceBuilder(int dim, int index)
Create a new Variable.Builder that is a logical slice of this one, by fixing the specified dimension at the specified index value.- Parameters:
dim- which dimension to fixindex- at what index value
-
copy
public Variable.Builder<?> copy()
-
copyFrom
public T copyFrom(Variable.Builder<?> builder)
-
-