Package cds.moc

Class Range2

All Implemented Interfaces:
Comparable<Range>

public class Range2 extends 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
  • Field Details

  • Constructor Details

    • Range2

      public Range2()
    • Range2

      public Range2(int cap)
    • Range2

      public Range2(Range2 other)
  • Method Details

    • resize

      public void resize(int newsize)
      Description copied from class: Range
      Modify the size of the vector
      Overrides:
      resize in class Range
    • trimSize

      public void trimSize()
      Description copied from class: Range
      Shrinks the array for the entries to minimum size.
      Overrides:
      trimSize in class Range
    • degrade

      public Range2 degrade(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é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

      public Range2 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émoire
      Overrides:
      degrade in class Range
      Parameters:
      shift - Nombre de bits dégradés (1 => dégradation d'un facteur 2, 2 => d'un facteur 4...)
      Returns:
      un nouveau Range dégradé
    • append

      public void append(long a, long b, Range m)
      Append a range to the object.
      Parameters:
      a - first long in range
      b - one-after-last long in range
      m - Spatial MOC associated to the range
    • append

      public void append(Range2 other)
      Append an entire range set to the object.
    • push

      public void push(long min, long max, Range m)
      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 class Range
    • union

      public Range2 union(Range2 other)
      Return the union of this Range and other.
    • intersection

      public Range2 intersection(Range2 other)
      Return the intersection of this Range and other.
    • difference

      public Range2 difference(Range2 other)
      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.
      Overrides:
      indexOf in class Range
      Parameters:
      val - number whose interval is requested
      Returns:
      interval number, starting with -1 (smaller than all numbers in the Range), 0 (first "on" interval), 1 (first "off" interval etc.), up to (and including) sz-1 (larger than all numbers in the Range).
    • overlaps

      public boolean overlaps(Range other)
      Description copied from class: Range
      Returns true if there is overlap between the set and "other", else false.
      Overrides:
      overlaps in class Range
    • contains

      public boolean contains(Range other)
      Overrides:
      contains in class Range
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Range
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Range
    • checkConsistency

      public void checkConsistency()
      Checks the object for internal consistency. If a problem is detected, an IllegalArgumentException is thrown.
      Overrides:
      checkConsistency in class Range
    • check

      public boolean check()
    • getMem

      public long getMem()
      RAM usage (in bytes)
      Overrides:
      getMem in class Range
    • add

      public void add(long a, long b, Range m)
    • 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[.
      Overrides:
      add in class Range
    • 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[.
      Overrides:
      remove in class Range
    • 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[.
      Overrides:
      remove in class Range