gzz.media.impl
Class ScrollBlockManager.Span1DBase

java.lang.Object
  |
  +--gzz.media.impl.ScrollBlockManager.SpanBase
        |
        +--gzz.media.impl.ScrollBlockManager.Span1DBase
All Implemented Interfaces:
java.io.Serializable, Span, Span1D
Direct Known Subclasses:
ScrollBlockManager.PageSpanBase
Enclosing class:
ScrollBlockManager

public abstract static class ScrollBlockManager.Span1DBase
extends ScrollBlockManager.SpanBase
implements Span1D, java.io.Serializable

A base class for 1-D spans. Implements everything except the actual getText().

See Also:
Serialized Form

Field Summary
protected  int offs0
           
protected  int offs1
           
 
Fields inherited from interface gzz.media.Span1D
rcsid
 
Constructor Summary
protected ScrollBlockManager.Span1DBase(ScrollBlockManager.MediaserverScrollBlock sb, int offs0, int offs1)
          Create a new 1-D span, which starts at offs0 and ends just before offs1 - analogous to String.substring.
 
Method Summary
 Span1D append(Span s)
          Return the span that results from appending the other span to this span, if the resulting span is contiguous.
protected abstract  ScrollBlockManager.Span1DBase createNew(int offs0, int offs1)
           
 boolean equals(java.lang.Object o)
           
 int getRelativeEnd(Span1D subspan)
          Get the end of the given subspan, relative to the start of this.
 int getRelativeStart(Span1D subspan)
          Get the start of the given subspan, relative to the start of this.
 int hashCode()
           
 boolean intersects(Span s)
          Whether this span and the given span intersect.
 boolean intersectsAfter(Span s)
           
 boolean intersectsBefore(Span s)
           
 int length()
          Get the length of this span, in natural units.
 int offset()
          Get the offset of this span inside the Mediaserver block, in natural units starting at zero.
 Span1D subSpan(int o1)
          Return the subSpan starting at o1 in natural units and ending at the end of this span, analogous to java.lang.String.substring().
 Span1D subSpan(int o1, int o2)
          Return the subSpan starting at o1 in natural units and ending just before o2, analogous to java.lang.String.substring().
 java.lang.String toString()
           
 
Methods inherited from class gzz.media.impl.ScrollBlockManager.SpanBase
getScrollBlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gzz.media.Span
getScrollBlock
 

Field Detail

offs0

protected int offs0

offs1

protected int offs1
Constructor Detail

ScrollBlockManager.Span1DBase

protected ScrollBlockManager.Span1DBase(ScrollBlockManager.MediaserverScrollBlock sb,
                                        int offs0,
                                        int offs1)
Create a new 1-D span, which starts at offs0 and ends just before offs1 - analogous to String.substring.

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

offset

public int offset()
Description copied from interface: Span1D
Get the offset of this span inside the Mediaserver block, in natural units starting at zero.

Specified by:
offset in interface Span1D

length

public int length()
Description copied from interface: Span1D
Get the length of this span, in natural units.

Specified by:
length in interface Span1D

subSpan

public Span1D subSpan(int o1,
                      int o2)
Description copied from interface: Span1D
Return the subSpan starting at o1 in natural units and ending just before o2, analogous to java.lang.String.substring().

Specified by:
subSpan in interface Span1D

createNew

protected abstract ScrollBlockManager.Span1DBase createNew(int offs0,
                                                           int offs1)

subSpan

public Span1D subSpan(int o1)
Description copied from interface: Span1D
Return the subSpan starting at o1 in natural units and ending at the end of this span, analogous to java.lang.String.substring().

Specified by:
subSpan in interface Span1D

getRelativeStart

public int getRelativeStart(Span1D subspan)
Description copied from interface: Span1D
Get the start of the given subspan, relative to the start of this. subspan must be wholly contained in this span; otherwise, an error is thrown.

Specified by:
getRelativeStart in interface Span1D

getRelativeEnd

public int getRelativeEnd(Span1D subspan)
Description copied from interface: Span1D
Get the end of the given subspan, relative to the start of this. subspan must be wholly contained in this span; otherwise, an error is thrown.

Specified by:
getRelativeEnd in interface Span1D

append

public Span1D append(Span s)
Description copied from interface: Span1D
Return the span that results from appending the other span to this span, if the resulting span is contiguous. Otherwise, returns null.

Specified by:
append in interface Span1D

intersects

public boolean intersects(Span s)
Description copied from interface: Span
Whether this span and the given span intersect.

Specified by:
intersects in interface Span

intersectsAfter

public boolean intersectsAfter(Span s)

intersectsBefore

public boolean intersectsBefore(Span s)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Specified by:
toString in interface Span
Overrides:
toString in class java.lang.Object