NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links


healpix.core.base.set
Class LongRangeSetBuilder

java.lang.Object
  extended by healpix.core.base.set.LongRangeSetBuilder

public class LongRangeSetBuilder
extends Object

Builder for LongRangeSet . LongRangeSet is unmodifiable, this class is 'factory' to create new instances.

To keep it fast and simple, this fab only supports appending. Uour ranges must be already sorted. This work for most of Healpix based operations.

LongRangeSet can also be constructed using LongSet


Field Summary
static LongRangeSet EMPTY
          empty LongRangeSet
 
Constructor Summary
LongRangeSetBuilder()
           
LongRangeSetBuilder(int arraySize)
          construct new builder with given array size
 
Method Summary
 void append(long first)
          append single long into builder
 void appendRange(long first, long last)
          append range into builder
 void appendRanges(LongRangeIterator iter)
          appends all ranges from iterator
 void appendRangeSet(LongRangeSet set)
          append all ranges from given LongRangeSet
 LongRangeSet build()
          Construct new LongRangeSet from appended values *
 void ensureSize(int arraySize)
          make sure underling array have at least given size
 long last()
           
 long lastFirst()
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final LongRangeSet EMPTY
empty LongRangeSet

Constructor Detail

LongRangeSetBuilder

public LongRangeSetBuilder()

LongRangeSetBuilder

public LongRangeSetBuilder(int arraySize)
construct new builder with given array size

Parameters:
size -
Method Detail

ensureSize

public void ensureSize(int arraySize)
make sure underling array have at least given size


append

public void append(long first)
append single long into builder

Parameters:
first - - long to append

appendRange

public void appendRange(long first,
                        long last)
append range into builder

Parameters:
first - long in range (inclusive)
last - long in range(inclusive)

last

public long last()

lastFirst

public long lastFirst()

appendRanges

public void appendRanges(LongRangeIterator iter)
appends all ranges from iterator

Parameters:
iter - LongRangeIterator

appendRangeSet

public void appendRangeSet(LongRangeSet set)
append all ranges from given LongRangeSet

Parameters:
set - LongRangeSet to append

size

public int size()
Returns:
number of added ranges so far

build

public LongRangeSet build()
Construct new LongRangeSet from appended values *

Returns:
LongRangeSet with appended values

"Built from revision exported"

Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650