gnu.jemacs.swt
Class SwtCharBuffer

java.lang.Object
  extended by gnu.lists.AbstractSequence
      extended by gnu.lists.GapVector
          extended by gnu.jemacs.swt.SwtCharBuffer
All Implemented Interfaces:
Consumable, Sequence, java.lang.CharSequence, java.lang.Iterable, java.util.Collection, java.util.List
Direct Known Subclasses:
BufferContent

public class SwtCharBuffer
extends GapVector
implements java.lang.CharSequence

TODO Explain that this is all about.


Field Summary
protected  FString chars
           
protected  LineOffsets lineOffsets
           
 
Fields inherited from class gnu.lists.GapVector
base, gapEnd, gapStart
 
Fields inherited from interface gnu.lists.Sequence
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
 
Constructor Summary
SwtCharBuffer(int initialSize)
           
 
Method Summary
 char charAt(int index)
           
 void delete(int where, int count)
           
protected  void gapReserve(int size)
          Make sure gap is at least 'size' elements long.
 void getChars(int start, int end, char[] dest, int destStart)
           
 void insert(int where, java.lang.String str)
           
 int length()
           
 int offset2pos(int offset)
           
 int pos2offset(int pos)
           
protected static java.lang.String printable(java.lang.String s)
           
protected  void shiftGap(int newGapStart)
           
protected  void show()
           
 java.lang.CharSequence subSequence(int start, int end)
           
 java.lang.String toString()
           
 
Methods inherited from class gnu.lists.GapVector
add, addPos, consumePosRange, createPos, fill, fillPosRange, gapReserve, get, getNextKind, getSegment, hasNext, isAfterPos, nextIndex, removePosRange, set, size
 
Methods inherited from class gnu.lists.AbstractSequence
add, addAll, addAll, clear, compare, compare, compare, consume, consumeNext, contains, containsAll, copyPos, createRelativePos, elements, endPos, equals, equals, fill, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasPrevious, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, retainAll, set, setPosNext, setPosPrevious, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, unsupported, unsupportedException
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gnu.lists.Sequence
elements, isEmpty
 
Methods inherited from interface java.util.List
add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, subList, toArray, toArray
 
Methods inherited from interface gnu.lists.Consumable
consume
 

Field Detail

chars

protected FString chars

lineOffsets

protected LineOffsets lineOffsets
Constructor Detail

SwtCharBuffer

public SwtCharBuffer(int initialSize)
Method Detail

subSequence

public java.lang.CharSequence subSequence(int start,
                                          int end)
Specified by:
subSequence in interface java.lang.CharSequence

pos2offset

public int pos2offset(int pos)

offset2pos

public int offset2pos(int offset)

gapReserve

protected void gapReserve(int size)
Description copied from class: GapVector
Make sure gap is at least 'size' elements long.

Overrides:
gapReserve in class GapVector
See Also:
GapVector.gapReserve(int)

shiftGap

protected void shiftGap(int newGapStart)
Overrides:
shiftGap in class GapVector
See Also:
GapVector.shiftGap(int)

length

public int length()
Specified by:
length in interface java.lang.CharSequence
See Also:
CharSequence.length()

charAt

public char charAt(int index)
Specified by:
charAt in interface java.lang.CharSequence
See Also:
CharSequence.charAt(int)

insert

public void insert(int where,
                   java.lang.String str)
Parameters:
where -
str -

delete

public void delete(int where,
                   int count)
Parameters:
where -
count -

getChars

public void getChars(int start,
                     int end,
                     char[] dest,
                     int destStart)

toString

public java.lang.String toString()
Specified by:
toString in interface java.lang.CharSequence
Overrides:
toString in class AbstractSequence

show

protected void show()

printable

protected static java.lang.String printable(java.lang.String s)