Package cds.moc
Class Range2
java.lang.Object
cds.moc.Range
cds.moc.Range2
- All Implemented Interfaces:
Comparable<Range>
Adaptation invalid input: '&' 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 TypeMethodDescriptionvoidadd(long a) After this operation, the Range contains the union of itself and [a;a+1[.voidvoidAppend a range to the object.voidAppend an entire range set to the object.booleancheck()voidChecks the object for internal consistency.booleandegrade(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.booleanlonggetMem()RAM usage (in bytes)inthashCode()intindexOf(long val) Returns an internal representation of the interval a number belongs to.intersection(Range2 other) Return the intersection of this Range and other.booleanReturns true if there is overlap between the set and "other", else false.voidPush two entries at the end of the entry vector (no check)voidremove(long a) After this operation, the Range contains the difference of itself and [a;a+1[.voidremove(long a, long b) After this operation, the Range contains the difference of itself and [a;b[.voidresize(int newsize) Modify the size of the vectorvoidSort and remove useless ranges and trim the buffer => Warning: not thread safevoidtrimSize()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:RangeModify the size of the vector -
trimSize
public void trimSize()Description copied from class:RangeShrinks 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:
sortAndFixin 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:RangeReturns an internal representation of the interval a number belongs to. -
overlaps
Description copied from class:RangeReturns 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:
checkConsistencyin classRange
-
check
public boolean check() -
getMem
public long getMem()RAM usage (in bytes) -
add
-
add
public void add(long a) Description copied from class:RangeAfter 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:RangeAfter this operation, the Range contains the difference of itself and [a;b[. -
remove
public void remove(long a) Description copied from class:RangeAfter this operation, the Range contains the difference of itself and [a;a+1[.
-