gzz.media
Interface Span1D

gzz.media.Span gzz.media.Enfilade1D gzz.media.Span1D gzz.media.TextSpan gzz.media.ImageSpan gzz.media.PageSpan gzz.media.VideoSpan gzz.media.AudioSpan gzz.media.ScrollBlock ../../../Gzz_CoreAPIs.gen.html#media media_small
All Superinterfaces:
Span
All Known Subinterfaces:
AudioSpan, PageSpan, TextSpan, VideoSpan
All Known Implementing Classes:
FakeTextSpan, ScrollBlockManager.PageSpanBase, ScrollBlockManager.Span1DBase

public interface Span1D
extends Span

A 1-dimensional span inside one document. The different routines use "natural units" the definition of which depends on the span type - see the appropriate subinterfaces. IMMUTABLE


Field Summary
static java.lang.String rcsid
           
 
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.
 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 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().
 
Methods inherited from interface gzz.media.Span
getScrollBlock, intersects, toString
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values
Method Detail

offset

public int offset()
Get the offset of this span inside the Mediaserver block, in natural units starting at zero.


length

public int length()
Get the length of this span, in natural units.


subSpan

public 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().


subSpan

public 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().


getRelativeStart

public int getRelativeStart(Span1D subspan)
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.


getRelativeEnd

public int getRelativeEnd(Span1D subspan)
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.


append

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