API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. GapContent View Source
Author(s)
Timothy Prinzing
Since
Version
1.21 12/03/01
Serial
Hierarchy
 Object
      GapVector
          GapContent
Implements
 AbstractDocument.Content
 Serializable
Subclasses
Description
public class GapContent
  An implementation of the AbstractDocument.Content interface implemented using a gapped buffer similar to that used by emacs.
See also:   
Constructors
public GapContent ()
  Creates a new GapContent object.
public GapContent (int initialLength)
  Creates a new GapContent object, with the initial size specified.
Methods
Hide/Show inherited methods
protected Object allocateArray (int len) [Specified in GapVector]
Allocate an array to store items of the type appropriate (which is determined by the subclass).
pack-private void close (int position, int nItems) [Inherited From GapVector]
  Delete nItems at position.
pack-privatefinal int compare (MarkData o1, MarkData o2)
  Compares two marks.
public Position createPosition (int offset) throws BadLocationException [Specified in AbstractDocument.Content]
  Creates a position within the content that will track change as the content is mutated.
pack-privatefinal int findMarkAdjustIndex (int searchIndex)
Finds the index to start mark adjustments given some search index.
pack-privatefinal int findSortIndex (MarkData o)
  Finds the index of where to insert a new mark.
protectedfinal Object getArray () [Inherited From GapVector]
  Access to the array.
protected int getArrayLength () [Specified in GapVector]
Get the length of the allocated array.
public void getChars (int where, int len, Segment chars) throws BadLocationException [Specified in AbstractDocument.Content]
  Retrieves a portion of the content.
protectedfinal int getGapEnd () [Inherited From GapVector]
Access to the end of the gap.
protectedfinal int getGapStart () [Inherited From GapVector]
Access to the start of the gap.
pack-private int getNewArraySize (int reqSize) [Overrides GapVector]
Overridden to make growth policy less agressive for large text amount.
protected Vector getPositionsInRange (Vector v, int offset, int length)
  Returns a Vector containing instances of UndoPosRef for the Positions in the range offset to offset + length.
public String getString (int where, int len) throws BadLocationException [Specified in AbstractDocument.Content]
  Retrieves a portion of the content.
public UndoableEdit insertString (int where, String str) throws BadLocationException [Specified in AbstractDocument.Content]
  Inserts a string into the content.
public int length () [Specified in AbstractDocument.Content]
  Returns the length of the content.
pack-private int open (int position, int nItems) [Inherited From GapVector]
  Make space for the given number of items at the given location.
public UndoableEdit remove (int where, int nitems) throws BadLocationException [Specified in AbstractDocument.Content]
  Removes part of the content.
pack-privatefinal void removeUnusedMarks ()
Remove all unused marks out of the sorted collection of marks.
protected void replace (int position, int rmSize, Object addItems, int addSize) [Inherited From GapVector]
  Replace the given logical position in the storage with the given new items.
protected void resetMarksAtZero ()
Resets all the marks that have an offset of 0 to have an index of zero as well.
pack-private void resize (int nsize) [Inherited From GapVector]
resize the underlying storage array to the given new size
protected void shiftEnd (int newSize) [Overrides GapVector]
Make the gap bigger, moving any necessary data and updating the appropriate marks
protected void shiftGap (int newGapStart) [Overrides GapVector]
  Move the start of the gap to a new location, without changing the size of the gap.
protected void shiftGapEndUp (int newGapEnd) [Overrides GapVector]
  Adjust the gap end upward.
protected void shiftGapStartDown (int newGapStart) [Overrides GapVector]
  Adjust the gap end downward.
protected void updateUndoPositions (Vector positions, int offset, int length)
  Resets the location for all the UndoPosRef instances in positions.
Fields
Hide/Show inherited fields
pack-privatefinalstatic int GROWTH_SIZE = "524288"
Nested Classes
  GapContent.MarkData
Holds the data for a mark...
  GapContent.StickyPosition
  GapContent.MarkVector
  GapContent.UndoPosRef
Used to hold a reference to a Mark that is being reset as the result of removing from the content.
  GapContent.InsertUndo
UnoableEdit created for inserts.
  GapContent.RemoveUndo
UndoableEdit created for removes.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar