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 classSparseArray.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 intcountMissing()intcountNotMissing()List<T>getContent()TgetContent(int idx)TgetContent(int[] index)floatgetDensity()intgetNdups()intgetRank()int[]getShape()intgetTotalSize()int[]getTrack()intgetTrack(int idx)voidshowContent(Formatter f)voidshowInfo(Formatter info, GribRecordStats all)voidshowMissing(Formatter info)voidshowTracks(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)
-
-