From de690712a89a52f3d6c820049338c310ea7e3ad2 Mon Sep 17 00:00:00 2001 From: fxpineau Date: Tue, 26 Nov 2024 14:53:12 +0100 Subject: [PATCH] Add method 'getNHash' to 'HealpixNested' and 'HealpixNestedFast', see issue #19 --- src/main/java/cds/healpix/HealpixNested.java | 10 ++++++++++ src/main/java/cds/healpix/HealpixNestedFast.java | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/main/java/cds/healpix/HealpixNested.java b/src/main/java/cds/healpix/HealpixNested.java index 26a622b..cb11e4b 100644 --- a/src/main/java/cds/healpix/HealpixNested.java +++ b/src/main/java/cds/healpix/HealpixNested.java @@ -146,6 +146,16 @@ public HashComputer newHashComputer() { return new HealpixNestedHashComputer(this); } + /** + * Returns the total number of distinct hash values (i.e. the number of HEALPix cells) + * at this object HEALPix depth. + * @return the total number of distinct hash values (i.e. the number of HEALPix cells) + * at this object HEALPix depth. + */ + public long getNHash() { + return this.nHash; + } + /** * WARNING: the return object in not thread-safe! * @param auxAxis object describing the auxiliary axis diff --git a/src/main/java/cds/healpix/HealpixNestedFast.java b/src/main/java/cds/healpix/HealpixNestedFast.java index d50e74b..1dba198 100644 --- a/src/main/java/cds/healpix/HealpixNestedFast.java +++ b/src/main/java/cds/healpix/HealpixNestedFast.java @@ -146,6 +146,16 @@ public HealpixNestedFast(final int depth, FillingCurve2DType fillingCurveType) { this.fc = fillingCurveType.get(depth); } + /** + * Returns the total number of distinct hash values (i.e. the number of HEALPix cells) + * at this object HEALPix depth. + * @return the total number of distinct hash values (i.e. the number of HEALPix cells) + * at this object HEALPix depth. + */ + public long getNHash() { + return this.nHash; + } + @Override public int depth() { return this.depth;