Package cds.moc
Class Range2
java.lang.Object
cds.moc.Range
cds.moc.Range2
- All Implemented Interfaces:
Comparable<Range>
Adaptation & extension of RangeSet from Healpix.essentials lib (GNU General Public License)
from Martin Reinecke [Max-Planck-Society] built from Jan Kotek's "LongRange" class
Allow to associate an object to each range in order to build a 2 dimensional MOC
-
Nested Class Summary
Nested classes/interfaces inherited from class cds.moc.Range
Range.ValueIterator
-
Field Summary
FieldsFields inherited from class cds.moc.Range
EMPTY_ITER, r, sz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(long a) After this operation, the Range contains the union of itself and [a;a+1[.void
void
Append a range to the object.void
Append an entire range set to the object.boolean
check()
void
Checks the object for internal consistency.boolean
degrade
(int shift) Retourne un range dont la précision des intervalles est dégradée en fonction d'un nombre de bits Aggrège les intervalles si nécessaires et ajuste l'occupation mémoiredegrade
(int shift1, int shift2) Retourne un range dont la précision des intervalles est dégradée en fonction d'un nombre de bits Aggrège les intervalles si nécessaires et ajuste l'occupation mémoiredifference
(Range2 other) Return the difference of this Range and other.boolean
long
getMem()
RAM usage (in bytes)int
hashCode()
int
indexOf
(long val) Returns an internal representation of the interval a number belongs to.intersection
(Range2 other) Return the intersection of this Range and other.boolean
Returns true if there is overlap between the set and "other", else false.void
Push two entries at the end of the entry vector (no check)void
remove
(long a) After this operation, the Range contains the difference of itself and [a;a+1[.void
remove
(long a, long b) After this operation, the Range contains the difference of itself and [a;b[.void
resize
(int newsize) Modify the size of the vectorvoid
Sort and remove useless ranges and trim the buffer => Warning: not thread safevoid
trimSize()
Shrinks the array for the entries to minimum size.Return the union of this Range and other.Methods inherited from class cds.moc.Range
add, add, append, append, append, begins, clear, compareTo, complement, contains, contains, difference, ends, ensureCapacity, fromArray, generalAllOrNothing, ilog2, intersection, isEmpty, nranges, nval, overlaps, push, strategy, toArray, toString, trimIfTooLarge, union, valueIterator
-
Field Details
-
rr
-
-
Constructor Details
-
Range2
public Range2() -
Range2
public Range2(int cap) -
Range2
-
-
Method Details
-
resize
public void resize(int newsize) Description copied from class:Range
Modify the size of the vector -
trimSize
public void trimSize()Description copied from class:Range
Shrinks the array for the entries to minimum size. -
degrade
Retourne un range dont la précision des intervalles est dégradée en fonction d'un nombre de bits Aggrège les intervalles si nécessaires et ajuste l'occupation mémoire- Parameters:
shift1
- Nombre de bits dégradés - première dimension (1 => dégradation d'un facteur 2, 2 => d'un facteur 4...)shift2
- Nombre de bits dégradés - deuxième dimension (1 => dégradation d'un facteur 2, 2 => d'un facteur 4...)- Returns:
- un nouveau Range dégradé
-
degrade
Retourne un range dont la précision des intervalles est dégradée en fonction d'un nombre de bits Aggrège les intervalles si nécessaires et ajuste l'occupation mémoire -
append
Append a range to the object.- Parameters:
a
- first long in rangeb
- one-after-last long in rangem
- Spatial MOC associated to the range
-
append
Append an entire range set to the object. -
push
Push two entries at the end of the entry vector (no check) -
sortAndFix
public void sortAndFix()Sort and remove useless ranges and trim the buffer => Warning: not thread safe- Overrides:
sortAndFix
in classRange
-
union
Return the union of this Range and other. -
intersection
Return the intersection of this Range and other. -
difference
Return the difference of this Range and other. -
indexOf
public int indexOf(long val) Description copied from class:Range
Returns an internal representation of the interval a number belongs to. -
overlaps
Description copied from class:Range
Returns true if there is overlap between the set and "other", else false. -
contains
-
equals
-
hashCode
public int hashCode() -
checkConsistency
public void checkConsistency()Checks the object for internal consistency. If a problem is detected, an IllegalArgumentException is thrown.- Overrides:
checkConsistency
in classRange
-
check
public boolean check() -
getMem
public long getMem()RAM usage (in bytes) -
add
-
add
public void add(long a) Description copied from class:Range
After this operation, the Range contains the union of itself and [a;a+1[. -
remove
public void remove(long a, long b) Description copied from class:Range
After this operation, the Range contains the difference of itself and [a;b[. -
remove
public void remove(long a) Description copied from class:Range
After this operation, the Range contains the difference of itself and [a;a+1[.
-