| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | Spans.
Holds a single half-open interval. |
| pack-priv static class | Spans.
This class ranks a pair of |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | kMaxAddsSinceSort
This class will sort and collapse its span
entries after this many span additions via
the |
| private int | mAddsSinceSort
The number of |
| private List | mSpans
Holds a list of individual Span instances. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(float start, float end)
Add a span covering the half open interval
including |
| public void | |
| public boolean | intersects(float start, float end)
Returns true if the span defined by the half-open
interval from |
| private void |
| kMaxAddsSinceSort | back to summary |
|---|---|
| private static final int kMaxAddsSinceSort This class will sort and collapse its span
entries after this many span additions via
the | |
| mAddsSinceSort | back to summary |
|---|---|
| private int mAddsSinceSort The number of | |
| mSpans | back to summary |
|---|---|
| private List<Spans. Holds a list of individual Span instances. | |
| Spans | back to summary |
|---|---|
| public Spans() | |
| add | back to summary |
|---|---|
| public void add(float start, float end) Add a span covering the half open interval
including | |
| addInfinite | back to summary |
|---|---|
| public void addInfinite() Add a span which covers the entire range.
This call is logically equivalent to
| |
| intersects | back to summary |
|---|---|
| public boolean intersects(float start, float end) Returns true if the span defined by the half-open
interval from | |
| sortAndCollapse | back to summary |
|---|---|
| private void sortAndCollapse() Sort the spans in ascending order by their start position. After the spans are sorted collapse any spans that intersect into a single span. The result is a sorted, non-overlapping list of spans. | |
| Modifier and Type | Field and Description |
|---|---|
| private float | mEnd
The span goes up to but does not include the ending point. |
| private float | mStart
The span includes the starting point. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(Spans.
Implements java. Rank spans according to their starting position. |
| pack-priv boolean | contains(float pos)
Return true if the passed in position
lies in the half-open interval defined
by this |
| pack-priv final float | |
| pack-priv final float | |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv boolean | |
| public String |
| mEnd | back to summary |
|---|---|
| private float mEnd The span goes up to but does not include the ending point. | |
| mStart | back to summary |
|---|---|
| private float mStart The span includes the starting point. | |
| Span | back to summary |
|---|---|
| pack-priv Span(float start, float end) Create a half-open interval including
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(Spans. Implements java. Rank spans according to their starting position. The end position is ignored in this ranking.
| |
| contains | back to summary |
|---|---|
| pack-priv boolean contains(float pos) Return true if the passed in position
lies in the half-open interval defined
by this | |
| getEnd | back to summary |
|---|---|
| pack-priv final float getEnd() Return the end of the | |
| getStart | back to summary |
|---|---|
| pack-priv final float getStart() Return the start of the | |
| setEnd | back to summary |
|---|---|
| pack-priv final void setEnd(float end) Change the terminal position of the
| |
| setStart | back to summary |
|---|---|
| pack-priv final void setStart(float start) Change the initial position of the
| |
| subsume | back to summary |
|---|---|
| pack-priv boolean subsume(Spans. Attempt to alter this | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
Span
instances. If the instances intersect they
are deemed equal otherwise they are ranked
by their relative position. Use
SpanIntersection.instance to
get the single instance of this class.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Spans. | instance
This class is a Singleton and the following is the single instance. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int |
| instance | back to summary |
|---|---|
| pack-priv static final Spans. This class is a Singleton and the following is the single instance. | |
| SpanIntersection | back to summary |
|---|---|
| private SpanIntersection() Only this class can create instances of itself. | |
| compare | back to summary |
|---|---|
| public int compare(Spans. Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |