gzz.media.impl
Class TransientTextScroll

java.lang.Object
  |
  +--gzz.media.impl.TransientTextScroll
All Implemented Interfaces:
ScrollBlock, ScrollBlockManager.MediaserverScrollBlock, TextScrollBlock

public class TransientTextScroll
extends java.lang.Object
implements TextScrollBlock, ScrollBlockManager.MediaserverScrollBlock

A text scroll block.


Field Summary
 
Fields inherited from interface gzz.media.TextScrollBlock
rcsid
 
Constructor Summary
TransientTextScroll()
           
 
Method Summary
 TextSpan append(char ch)
          Do compare by identity for now! public boolean equals(Object o) { if(!(o instanceof ScrollBlock)) return false; if(this == o) return true; if(mediaserverId == null) return false; ScrollBlock sb = (ScrollBlock)o; return sb.getID().equals(getID()); } public int hashCode() { if(mediaserverId == null) throw new Error("Not finalized-- cannot hash yet"); return getID().hashCode(); } public String toString() { return "TransientTextScroll<"+getID()+">"; }
 TextSpan append(java.lang.String s)
           
 char[] getCharArray()
          Get the internal character array of this scrollblock.
 Span getCurrent()
          Get the current contents of this block as a single span of the appropriate type.
 java.lang.String getID()
          Get the globally unique identifier of this block.
 Span getSpan(int offs1, int offs2)
          Get a span that represents the given range inside this scrollblock.
 boolean isFinalized()
          Whether this block has been finalized or whether more can be appended.
 Mediaserver.Id saveOrGetId(Mediaserver saveTo)
          Get the Mediaserver id of this block; save when not saved yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransientTextScroll

public TransientTextScroll()
Method Detail

append

public TextSpan append(char ch)
                throws gzz.errors.ImmutableException
Do compare by identity for now! public boolean equals(Object o) { if(!(o instanceof ScrollBlock)) return false; if(this == o) return true; if(mediaserverId == null) return false; ScrollBlock sb = (ScrollBlock)o; return sb.getID().equals(getID()); } public int hashCode() { if(mediaserverId == null) throw new Error("Not finalized-- cannot hash yet"); return getID().hashCode(); } public String toString() { return "TransientTextScroll<"+getID()+">"; }

Specified by:
append in interface TextScrollBlock
gzz.errors.ImmutableException

append

public TextSpan append(java.lang.String s)
                throws gzz.errors.ImmutableException
Specified by:
append in interface TextScrollBlock
gzz.errors.ImmutableException

getCurrent

public Span getCurrent()
Description copied from interface: ScrollBlock
Get the current contents of this block as a single span of the appropriate type.

Specified by:
getCurrent in interface ScrollBlock

getSpan

public Span getSpan(int offs1,
                    int offs2)
Description copied from interface: TextScrollBlock
Get a span that represents the given range inside this scrollblock. Equivalent to getCurrent().subSpan(offs1,offs2).

Specified by:
getSpan in interface TextScrollBlock
Parameters:
offs1 - The offset the span should start at.
offs2 - The one-past-end offset.

isFinalized

public boolean isFinalized()
Description copied from interface: ScrollBlock
Whether this block has been finalized or whether more can be appended.

Specified by:
isFinalized in interface ScrollBlock

getID

public java.lang.String getID()
Description copied from interface: ScrollBlock
Get the globally unique identifier of this block. XXX Exact semantics, tmp ids

Specified by:
getID in interface ScrollBlock

saveOrGetId

public Mediaserver.Id saveOrGetId(Mediaserver saveTo)
                           throws java.io.IOException
Description copied from interface: ScrollBlockManager.MediaserverScrollBlock
Get the Mediaserver id of this block; save when not saved yet.

Specified by:
saveOrGetId in interface ScrollBlockManager.MediaserverScrollBlock
java.io.IOException

getCharArray

public char[] getCharArray()
Description copied from interface: TextScrollBlock
Get the internal character array of this scrollblock. This is used for speeding up drawing strings from a TextScrollBlock by being able to give a scrollblock and two offsets to the drawing routines.

THE RETURNED CHARACTER ARRAY MUST NOT BE MODIFIED UNDER ANY CIRCUMSTANCES.

Specified by:
getCharArray in interface TextScrollBlock