gnu.jemacs.swt
Class BufferContent

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

public class BufferContent
extends SwtCharBuffer
implements CharSeq


Field Summary
 
Fields inherited from class gnu.jemacs.swt.SwtCharBuffer
chars, 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
BufferContent()
           
BufferContent(int initialSize)
           
 
Method Summary
 void addTextChangeListener(TextChangeListener textChangeListener)
           
 void consume(int start, int count, Consumer out)
           
 void fill(char value)
          Set all the elements to a given character.
 void fill(int fromIndex, int toIndex, char value)
           
 int getCharCount()
           
 java.lang.String getLine(int lineIndex)
           
 int getLineAtOffset(int pos)
           
 int getLineCount()
           
 java.lang.String getLineDelimiter()
           
 int getOffsetAtLine(int lineIndex)
           
 java.lang.String getTextRange(int start, int length)
           
 void insertFile(java.io.Reader in, int pos)
           
 int lineStartPos(int pos)
           
static void main(java.lang.String[] args)
          For testing purposes
 void removeTextChangeListener(TextChangeListener textChangeListener)
           
 void replaceTextRange(int start, int length, java.lang.String newText)
           
 void save(java.io.Writer out)
           
 void setCharAt(int index, char value)
           
 void setText(java.lang.String newText)
           
 java.lang.CharSequence subSequence(int start, int end)
           
 void writeTo(int start, int count, java.io.Writer dest)
          Write out (part of) this string.
 void writeTo(java.io.Writer dest)
           
 
Methods inherited from class gnu.jemacs.swt.SwtCharBuffer
charAt, delete, gapReserve, getChars, insert, length, offset2pos, pos2offset, printable, shiftGap, show, 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, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gnu.lists.CharSeq
charAt, getChars, length, toString
 
Methods inherited from interface gnu.lists.Sequence
elements, fill, get, isEmpty, set, size
 
Methods inherited from interface java.util.List
add, 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
 

Constructor Detail

BufferContent

public BufferContent()

BufferContent

public BufferContent(int initialSize)
Parameters:
initialSize -
Method Detail

addTextChangeListener

public void addTextChangeListener(TextChangeListener textChangeListener)
See Also:
org.eclipse.swt.custom.StyledTextContent#addTextChangeListener(org.eclipse.swt.custom.TextChangeListener)

removeTextChangeListener

public void removeTextChangeListener(TextChangeListener textChangeListener)
See Also:
org.eclipse.swt.custom.StyledTextContent#removeTextChangeListener(org.eclipse.swt.custom.TextChangeListener)

getCharCount

public int getCharCount()
See Also:
org.eclipse.swt.custom.StyledTextContent#getCharCount()

getLine

public java.lang.String getLine(int lineIndex)
See Also:
org.eclipse.swt.custom.StyledTextContent#getLine(int)

getLineAtOffset

public int getLineAtOffset(int pos)
See Also:
org.eclipse.swt.custom.StyledTextContent#getLineAtOffset(int)

getLineCount

public int getLineCount()
See Also:
org.eclipse.swt.custom.StyledTextContent#getLineCount()

getLineDelimiter

public java.lang.String getLineDelimiter()
See Also:
org.eclipse.swt.custom.StyledTextContent#getLineDelimiter()

getOffsetAtLine

public int getOffsetAtLine(int lineIndex)
See Also:
org.eclipse.swt.custom.StyledTextContent#getOffsetAtLine(int)

getTextRange

public java.lang.String getTextRange(int start,
                                     int length)
See Also:
org.eclipse.swt.custom.StyledTextContent#getTextRange(int, int)

replaceTextRange

public void replaceTextRange(int start,
                             int length,
                             java.lang.String newText)
See Also:
org.eclipse.swt.custom.StyledTextContent#replaceTextRange(int, int, java.lang.String)

setText

public void setText(java.lang.String newText)
See Also:
org.eclipse.swt.custom.StyledTextContent#setText(java.lang.String)

main

public static void main(java.lang.String[] args)
For testing purposes

Parameters:
args -

lineStartPos

public int lineStartPos(int pos)

consume

public void consume(int start,
                    int count,
                    Consumer out)
Specified by:
consume in interface CharSeq
Parameters:
start -
count -
out -

insertFile

public void insertFile(java.io.Reader in,
                       int pos)
                throws java.io.IOException
Parameters:
in -
Throws:
java.io.IOException

setCharAt

public void setCharAt(int index,
                      char value)
Specified by:
setCharAt in interface CharSeq

fill

public void fill(char value)
Description copied from interface: CharSeq
Set all the elements to a given character.

Specified by:
fill in interface CharSeq

fill

public void fill(int fromIndex,
                 int toIndex,
                 char value)
Specified by:
fill in interface CharSeq

subSequence

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

writeTo

public void writeTo(int start,
                    int count,
                    java.io.Writer dest)
             throws java.io.IOException
Description copied from interface: CharSeq
Write out (part of) this string.

Specified by:
writeTo in interface CharSeq
Parameters:
start - index of initial character to write
count - number of characters to write
dest - where to write the characters
Throws:
java.io.IOException

writeTo

public void writeTo(java.io.Writer dest)
             throws java.io.IOException
Specified by:
writeTo in interface CharSeq
Throws:
java.io.IOException

save

public void save(java.io.Writer out)
          throws java.io.IOException
Parameters:
out -
Throws:
java.io.IOException