public class BagMocBuilder extends Object implements MocBuilder
| Constructor and Description | 
|---|
BagMocBuilder(int maxOrder)
Constructor with default IndexBag creation policy. 
 | 
BagMocBuilder(int maxOrder,
             java.util.function.LongFunction<IndexBag> bagFactory)
Constructor with custom IndexBag creation policy. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addTile(int order,
       long ipix)
Add a numbered tile at a given order. 
 | 
void | 
consolidate()
Following a call to this method, the MOC is in normal form;
 no sets of 4 tiles in the same quad, no part of the sphere
 represented by more than one tile at different orders. 
 | 
PrimitiveIterator.OfLong | 
createOrderedUniqIterator()
Returns an iterator over the UNIQ values represented by this MOC
 in sequence. 
 | 
void | 
endTiles()
Signal that no further tiles will be added. 
 | 
long[] | 
getOrderCounts()
Returns an array of the number of tiles present at each order
 of the normalised MOC. 
 | 
static long | 
uniq(int order,
    long lindex)
Encodes an order and a tile index to a UNIQ value. 
 | 
public BagMocBuilder(int maxOrder)
maxOrder - maximum order stored by this MOCpublic BagMocBuilder(int maxOrder,
                     java.util.function.LongFunction<IndexBag> bagFactory)
maxOrder - maximum order stored by this MOCbagFactory - creates an IndexBag capable of storing non-negative
                     integers less than the supplied long valuepublic void addTile(int order,
                    long ipix)
MocBuilderaddTile in interface MocBuilderorder - HEALPix order, in the range 0..29ipix - tile index within the given order,
                in the range 0..12*4^orderpublic void endTiles()
MocBuilderendTiles in interface MocBuilderpublic PrimitiveIterator.OfLong createOrderedUniqIterator()
MocBuilderShould only be called after MocBuilder.endTiles() has been called.
createOrderedUniqIterator in interface MocBuilderpublic long[] getOrderCounts()
MocBuilderMocBuilder.createOrderedUniqIterator().
 Should only be called after MocBuilder.endTiles() has been called.
getOrderCounts in interface MocBuilderpublic void consolidate()
Calling this method during a run of tile additions may result in a smaller memory footprint or better performance. Or it may not.
public static long uniq(int order,
                        long lindex)
order - orderlindex - tile index within orderCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.