Java Reference

Java Reference

SortedDisjointIntervalList

Detailed Description

This class represents a sorted list of disjoint, closed intervals.

When an
interval is inserted, all intervals that overlap it or are adjacent to it are
merged into one. I.e. [0,14] and [15,30] will be merged to [0,30].

Iterators returned by this class are invalidated by non-const operations.

Definition at line 18 of file SortedDisjointIntervalList.java.

Public Member Functions

 SortedDisjointIntervalList (long cPtr, boolean cMemoryOwn)
 
synchronized void delete ()
 
 SortedDisjointIntervalList ()
 
 SortedDisjointIntervalList (long[] starts, long[] ends)
 Creates a SortedDisjointIntervalList and fills it with intervals
[starts[i]..ends[i]]. More...
 
 SortedDisjointIntervalList (int[] starts, int[] ends)
 
SortedDisjointIntervalList buildComplementOnInterval (long start, long end)
 Builds the complement of the interval list on the interval [start, end]. More...
 
SWIGTYPE_p_std__setT_operations_research__ClosedInterval_operations_research__SortedDisjointIntervalList__IntervalComparator_t__iterator insertInterval (long start, long end)
 Adds the interval [start..end] to the list, and merges overlapping or
immediately adjacent intervals ([2, 5] and [6, 7] are adjacent, but
[2, 5] and [7, 8] are not). More...
 
void insertIntervals (long[] starts, long[] ends)
 Adds all intervals [starts[i]..ends[i]]. More...
 
void insertIntervals (int[] starts, int[] ends)
 
int numIntervals ()
 Returns the number of disjoint intervals in the list. More...
 
String toString ()
 

Constructor & Destructor Documentation

◆ SortedDisjointIntervalList() [1/4]

SortedDisjointIntervalList ( long  cPtr,
boolean  cMemoryOwn 
)
inline

Definition at line 22 of file SortedDisjointIntervalList.java.

◆ SortedDisjointIntervalList() [2/4]

Definition at line 46 of file SortedDisjointIntervalList.java.

◆ SortedDisjointIntervalList() [3/4]

SortedDisjointIntervalList ( long[]  starts,
long[]  ends 
)
inline

Creates a SortedDisjointIntervalList and fills it with intervals
[starts[i]..ends[i]].

All intervals must be consistent (starts[i] <=
ends[i]). There are two version, one for int64 and one for int.

Definition at line 55 of file SortedDisjointIntervalList.java.

◆ SortedDisjointIntervalList() [4/4]

SortedDisjointIntervalList ( int[]  starts,
int[]  ends 
)
inline

Definition at line 59 of file SortedDisjointIntervalList.java.

Member Function Documentation

◆ buildComplementOnInterval()

SortedDisjointIntervalList buildComplementOnInterval ( long  start,
long  end 
)
inline

Builds the complement of the interval list on the interval [start, end].

Definition at line 66 of file SortedDisjointIntervalList.java.

◆ delete()

synchronized void delete ( )
inline

Definition at line 36 of file SortedDisjointIntervalList.java.

◆ insertInterval()

SWIGTYPE_p_std__setT_operations_research__ClosedInterval_operations_research__SortedDisjointIntervalList__IntervalComparator_t__iterator insertInterval ( long  start,
long  end 
)
inline

Adds the interval [start..end] to the list, and merges overlapping or
immediately adjacent intervals ([2, 5] and [6, 7] are adjacent, but
[2, 5] and [7, 8] are not).



Returns an iterator to the inserted interval (possibly merged with others).

If start > end, it does LOG(DFATAL) and returns end() (no interval added).

Definition at line 79 of file SortedDisjointIntervalList.java.

◆ insertIntervals() [1/2]

void insertIntervals ( int[]  starts,
int[]  ends 
)
inline

Definition at line 93 of file SortedDisjointIntervalList.java.

◆ insertIntervals() [2/2]

void insertIntervals ( long[]  starts,
long[]  ends 
)
inline

Adds all intervals [starts[i]..ends[i]].



Same behavior as InsertInterval() upon invalid intervals. There's a version
with int64 and int32.

Definition at line 89 of file SortedDisjointIntervalList.java.

◆ numIntervals()

int numIntervals ( )
inline

Returns the number of disjoint intervals in the list.

Definition at line 100 of file SortedDisjointIntervalList.java.

◆ toString()

String toString ( )
inline

Definition at line 104 of file SortedDisjointIntervalList.java.


The documentation for this class was generated from the following file: