gzz.media.impl
Class FakeTextSpan

java.lang.Object
  |
  +--gzz.media.impl.FakeTextSpan
All Implemented Interfaces:
java.io.Serializable, Span, Span1D, TextSpan

public class FakeTextSpan
extends java.lang.Object
implements TextSpan, java.io.Serializable

An object that behaves like a text span but is not stored in a real Storm block. Used for things like coordinates or other computer-generated rapidly changing content. Must be atomic: if you give one piece away, you give the whole thing away. Must be short, because the whole thing is repeated whereever one piece goes. See PEG miniblocks--benja.

See Also:
Serialized Form

Nested Class Summary
protected  class FakeTextSpan.FakeTextScrollBlock
           
 
Field Summary
static java.lang.String rcsid
           
 
Constructor Summary
FakeTextSpan(java.lang.String s)
           
 
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.
 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.
 ScrollBlock getScrollBlock()
          Get the ScrollBlock that this span points to.
 java.lang.String getText()
          Get the string contained in the span.
 int hashCode()
           
 boolean intersects(Span s)
          Whether this span and the given span intersect.
 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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

rcsid

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

FakeTextSpan

public FakeTextSpan(java.lang.String s)
Method Detail

getText

public java.lang.String getText()
Description copied from interface: TextSpan
Get the string contained in the span.

Specified by:
getText in interface TextSpan

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

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

equals

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

hashCode

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

toString

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

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

getScrollBlock

public ScrollBlock getScrollBlock()
Description copied from interface: Span
Get the ScrollBlock that this span points to.

Specified by:
getScrollBlock in interface Span