All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.UndoableContent

java.lang.Object
   |
   +----com.sun.java.swing.text.VersSequence
           |
           +----com.sun.java.swing.text.UndoableContent

public class UndoableContent
extends VersSequence
implements JDocument. Content, Serializable
Provide a versioned sequence of characters. This is intended to support efficient editing of character content that is potentially very large. Edits to the content can be efficiently undone and redone. This implementation is inefficient for character content that is very small (such as a text field for example).


Constructor Index

 o UndoableContent(int)
Construct a versioned character sequence.

Method Index

 o dataToString(Object, int, int)
Subclasses of this class should implement this to provide a debug string that illustrates the data in the given array in some meaningful way.
 o getChar(int)
Fetch a character contained in the sequence.
 o getString(int, int)
Fetch a string of characters contained in the sequence.
 o insertChar(int, char)
Insert a character into the sequence.
 o insertString(int, String)
Insert a string of characters into the sequence.

Constructors

 o UndoableContent
 public UndoableContent(int charPageSize)
Construct a versioned character sequence.

Parameters:
charPageSize - Specifies the amount of excess storage to allocate each time more storage is needed.

Methods

 o insertChar
 public UndoableEdit insertChar(int where,
                                char c) throws BadLocation
Insert a character into the sequence.

Parameters:
where - Offset into the sequence to make the insertion.
c - Character to insert.
Throws: BadLocation
If the given position does not represent a valid location in the associated document.
 o insertString
 public UndoableEdit insertString(int where,
                                  String str) throws BadLocation
Insert a string of characters into the sequence.

Parameters:
where - Offset into the sequence to make the insertion.
str - String to insert.
Throws: BadLocation
If the given position does not represent a valid location in the associated document.
 o getChar
 public char getChar(int where) throws BadLocation
Fetch a character contained in the sequence.

Parameters:
where - Offset into the sequence to fetch.
Throws: BadLocation
If the given position does not represent a valid location in the associated document.
 o getString
 public String getString(int where,
                         int len) throws BadLocation
Fetch a string of characters contained in the sequence.

Parameters:
where - Offset into the sequence to fetch.
len - number of characters to copy.
Throws: BadLocation
If the given position does not represent a valid location in the associated document.
 o dataToString
 protected String dataToString(Object array,
                               int offset,
                               int length)
Subclasses of this class should implement this to provide a debug string that illustrates the data in the given array in some meaningful way. This implementation displays the character string representing the data.

Overrides:
dataToString in class VersSequence

All Packages  Class Hierarchy  This Package  Previous  Next  Index