Package ucar.nc2.grib.coord
Class SparseArray<T>
- java.lang.Object
-
- ucar.nc2.grib.coord.SparseArray<T>
-
@Immutable public class SparseArray<T> extends Object
Store objects of type T in a sparse array. Conceptually a multidim array with shape[n] and totalsize. Stored as track[totalsize] = {0 = missing, else = index+1 into Listcontent} So we dont have to store missing Ts. - Since:
- 11/24/13
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SparseArray.Builder<T>
-
Constructor Summary
Constructors Constructor Description SparseArray(int[] shape, int[] track, List<T> content, int ndups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countMissing()
int
countNotMissing()
List<T>
getContent()
T
getContent(int idx)
T
getContent(int[] index)
float
getDensity()
int
getNdups()
int
getRank()
int[]
getShape()
int
getTotalSize()
int[]
getTrack()
int
getTrack(int idx)
void
showContent(Formatter f)
void
showInfo(Formatter info, GribRecordStats all)
void
showMissing(Formatter info)
void
showTracks(Formatter f)
-
-
-
Method Detail
-
getContent
@Nullable public T getContent(int idx)
-
getContent
public T getContent(int[] index)
-
getShape
public int[] getShape()
-
getRank
public int getRank()
-
getTotalSize
public int getTotalSize()
-
getTrack
public int[] getTrack()
-
getTrack
public int getTrack(int idx)
-
countNotMissing
public int countNotMissing()
-
countMissing
public int countMissing()
-
getDensity
public float getDensity()
-
getNdups
public int getNdups()
-
showInfo
public void showInfo(Formatter info, GribRecordStats all)
-
showMissing
public void showMissing(Formatter info)
-
showContent
public void showContent(Formatter f)
-
showTracks
public void showTracks(Formatter f)
-
-