|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthealpix.core.base.set.LongRangeSetBuilder
public class LongRangeSetBuilder
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 |
static LongRangeSet |
readFrom(DataInput in)
Read LongRangeSet from an input stream |
int |
size()
|
static void |
writeTo(DataOutput out,
LongRangeSet rs)
Write LongRangeSet into stream in an space efficient way. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final LongRangeSet EMPTY
Constructor Detail |
---|
public LongRangeSetBuilder()
public LongRangeSetBuilder(int arraySize)
arraySize
- Method Detail |
---|
public void ensureSize(int arraySize)
public void append(long first)
first
- - long to appendpublic void appendRange(long first, long last)
first
- long in range (inclusive)last
- long in range(inclusive)public void appendRanges(LongRangeIterator iter)
iter
- LongRangeIteratorpublic void appendRangeSet(LongRangeSet set)
set
- LongRangeSet to appendpublic int size()
public LongRangeSet build()
public static void writeTo(DataOutput out, LongRangeSet rs) throws IOException
out
- rs
-
IOException
public static LongRangeSet readFrom(DataInput in) throws IOException
in
-
IOException
|
"Built from revision exported" | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |