Package cds.healpix
Interface NeighbourSelector
-
- All Known Implementing Classes:
HealpixNested
,HealpixNestedFast
public interface NeighbourSelector
In this interface methods, we do not used anEnumMap
ofCompassPoint.MainWind
but aNeighbourList
because: 1 - we want to avoid autoboxing (a map storing Long and not long). 2 - we want to transparently deal with cases in which there is no neighbour in a given direction.- Author:
- F.-X. Pineau
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.EnumSet<CompassPoint.MainWind>
ALL_MAIN_WINDS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FlatHashList
externalEdges(long hash, int deltaDepth)
void
externalEdges(long hash, int deltaDepth, FlatHashList result)
long
internalCorner(long hash, int deltaDepth, CompassPoint.Cardinal direction)
long
internalCornerE(long hash, int deltaDepth)
long
internalCornerN(long hash, int deltaDepth)
long
internalCornerS(long hash, int deltaDepth)
long
internalCornerW(long hash, int deltaDepth)
FlatHashList
internalEdges(long hash, int deltaDepth)
void
internalEdges(long hash, int deltaDepth, FlatHashList result)
long
neighbour(long hash, CompassPoint.MainWind direction)
The hash value of the neighbour of the cell of given hash, in the given deirection.NeighbourList
neighbours(long hash)
Returns the list of the hash of the cells surrounding the cell defined by the given hash.void
neighbours(long hash, FlatHashList result)
Idem asneighbours(long, NeighbourList)
except that the result is put in a simpleFlatHashList
.void
neighbours(long hash, NeighbourList result)
Equivalent ofneighbours(long)
but passing in argument the list object to be filled.NeighbourList
neighbours(long hash, java.util.EnumSet<CompassPoint.MainWind> directions)
Equivalent ofneighbours(long, FlatHashList)
but with the list of direction of the wanted neighbours.void
neighbours(long hash, java.util.EnumSet<CompassPoint.MainWind> directions, NeighbourList result)
Equivalent ofneighbours(long, FlatHashList)
but with the list of direction of the wanted neighbours.FlatHashList
sortedExternalEdges(long hash, int deltaDepth)
void
sortedExternalEdges(long hash, int deltaDepth, FlatHashList result)
FlatHashList
sortedInternalEdge(long hash, int deltaDepth, CompassPoint.Ordinal direction)
void
sortedInternalEdge(long hash, int deltaDepth, CompassPoint.Ordinal direction, FlatHashList result)
FlatHashList
sortedInternalEdgeNE(long hash, int deltaDepth)
void
sortedInternalEdgeNE(long hash, int deltaDepth, FlatHashList result)
FlatHashList
sortedInternalEdgeNW(long hash, int deltaDepth)
void
sortedInternalEdgeNW(long hash, int deltaDepth, FlatHashList result)
FlatHashList
sortedInternalEdges(long hash, int deltaDepth)
void
sortedInternalEdges(long hash, int deltaDepth, FlatHashList result)
FlatHashList
sortedInternalEdgeSE(long hash, int deltaDepth)
void
sortedInternalEdgeSE(long hash, int deltaDepth, FlatHashList result)
FlatHashList
sortedInternalEdgeSW(long hash, int deltaDepth)
void
sortedInternalEdgeSW(long hash, int deltaDepth, FlatHashList result)
-
-
-
Field Detail
-
ALL_MAIN_WINDS
static final java.util.EnumSet<CompassPoint.MainWind> ALL_MAIN_WINDS
-
-
Method Detail
-
neighbour
long neighbour(long hash, CompassPoint.MainWind direction)
The hash value of the neighbour of the cell of given hash, in the given deirection.- Parameters:
hash
- ash value of the cell we are looking for the neighbour.direction
- direction of the neighbour we are looking for.- Returns:
- -1 if there is no neighbour in the given direction (hashes located at corners of base hases).
-
neighbours
NeighbourList neighbours(long hash)
Returns the list of the hash of the cells surrounding the cell defined by the given hash. The number of surrounding cells can be 8 (for all cells except the cells located at the corners of the 12 depth 0 cells), 7 (for the west and east corners of the polar caps, i.e. depth 0 cells number 0, 1, 2, 4, 8, 9, 10 and 11, or for the north and south corners of the equatorial regions, i.e. depth 0 cells number 4, 5, 6 and 7), or 6 for depth 0 pixels.- Parameters:
hash
- hash value of the cell we are looking for the neighbours.- Returns:
- the list of neighbours hashes
-
neighbours
void neighbours(long hash, NeighbourList result)
Equivalent ofneighbours(long)
but passing in argument the list object to be filled. WARNING: the content of the provided list is overwritten, and be sure the list is large enough (at least of size 8). And the value -1 is returned if the given hash has no neighbour at the given main wind direction.- Parameters:
hash
- the hash code we want the neighboursresult
- which contains the list of neighbours from index 0 to the number of neighbours
-
neighbours
void neighbours(long hash, FlatHashList result)
Idem asneighbours(long, NeighbourList)
except that the result is put in a simpleFlatHashList
. WARNING: the content of the provided list is overwritten, and be sure the list is large enough (at least of size 8).- Parameters:
hash
- the hash code we want the neighboursresult
- which contains the list of neighbours from index 0 to the number of neighbours
-
neighbours
NeighbourList neighbours(long hash, java.util.EnumSet<CompassPoint.MainWind> directions)
Equivalent ofneighbours(long, FlatHashList)
but with the list of direction of the wanted neighbours.- Parameters:
hash
- hash value of the cell we are looking for the neighbours.directions
- the directions of the neighbours we are looking for.- Returns:
- the list of the hash of the neighbours of the cell having the given hash.
-
neighbours
void neighbours(long hash, java.util.EnumSet<CompassPoint.MainWind> directions, NeighbourList result)
Equivalent ofneighbours(long, FlatHashList)
but with the list of direction of the wanted neighbours. And the value -1 is returned if the given hash has no neighbour at the given main wind direction.- Parameters:
hash
- hash value of the cell we are looking for the neighbours.directions
- the directions of the neighbours we are looking for.result
- the list holding the result.
-
internalEdges
FlatHashList internalEdges(long hash, int deltaDepth)
-
internalEdges
void internalEdges(long hash, int deltaDepth, FlatHashList result)
-
sortedInternalEdges
FlatHashList sortedInternalEdges(long hash, int deltaDepth)
-
sortedInternalEdges
void sortedInternalEdges(long hash, int deltaDepth, FlatHashList result)
-
sortedInternalEdge
FlatHashList sortedInternalEdge(long hash, int deltaDepth, CompassPoint.Ordinal direction)
-
sortedInternalEdge
void sortedInternalEdge(long hash, int deltaDepth, CompassPoint.Ordinal direction, FlatHashList result)
-
sortedInternalEdgeNE
FlatHashList sortedInternalEdgeNE(long hash, int deltaDepth)
-
sortedInternalEdgeNE
void sortedInternalEdgeNE(long hash, int deltaDepth, FlatHashList result)
-
sortedInternalEdgeNW
FlatHashList sortedInternalEdgeNW(long hash, int deltaDepth)
-
sortedInternalEdgeNW
void sortedInternalEdgeNW(long hash, int deltaDepth, FlatHashList result)
-
sortedInternalEdgeSE
FlatHashList sortedInternalEdgeSE(long hash, int deltaDepth)
-
sortedInternalEdgeSE
void sortedInternalEdgeSE(long hash, int deltaDepth, FlatHashList result)
-
sortedInternalEdgeSW
FlatHashList sortedInternalEdgeSW(long hash, int deltaDepth)
-
sortedInternalEdgeSW
void sortedInternalEdgeSW(long hash, int deltaDepth, FlatHashList result)
-
internalCorner
long internalCorner(long hash, int deltaDepth, CompassPoint.Cardinal direction)
-
internalCornerN
long internalCornerN(long hash, int deltaDepth)
-
internalCornerS
long internalCornerS(long hash, int deltaDepth)
-
internalCornerE
long internalCornerE(long hash, int deltaDepth)
-
internalCornerW
long internalCornerW(long hash, int deltaDepth)
-
externalEdges
FlatHashList externalEdges(long hash, int deltaDepth)
-
externalEdges
void externalEdges(long hash, int deltaDepth, FlatHashList result)
-
sortedExternalEdges
FlatHashList sortedExternalEdges(long hash, int deltaDepth)
-
sortedExternalEdges
void sortedExternalEdges(long hash, int deltaDepth, FlatHashList result)
-
-