<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Tue Jun 29 06:01:15 GMT+01:00 1999 -->
<TITLE>
Swing 1.1 API Specification: Class  GapContent
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/GapContent.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Swing 1.1</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/swing/text/FieldView.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/swing/text/IconView.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="GapContent.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.swing.text</FONT>
<BR>
Class  GapContent</H2>
<PRE>
java.lang.Object
  |
  +--javax.swing.text.GapVector
        |
        +--<B>javax.swing.text.GapContent</B>
</PRE>
<HR>
<DL>
<DT>public class <B>GapContent</B><DT>extends javax.swing.text.GapVector<DT>implements <A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A>, java.io.Serializable</DL>

<P>
An implementation of the AbstractDocument.Content interface 
 implemented using a gapped buffer similar to that used by emacs.
 The underlying storage is a array of unicode characters with
 a gap somewhere.  The gap is moved to the location of changes
 to take advantage of common behavior where most changes are
 in the same location.  Changes that occur at a gap boundry are
 generally cheap and moving the gap is generally cheaper than
 moving the array contents directly to accomodate the change.
 <p>
 The positions tracking change are also generally cheap to
 maintain.  The Position implementations (marks) store the array
 index and can easily calculate the sequential position from
 the current gap location.  Changes only require update to the
 the marks between the old and new gap boundries when the gap
 is moved, so generally updating the marks is pretty cheap.
 The marks are stored sorted so they can be located quickly
 with a binary search.  This increases the cost of adding a
 mark, and decreases the cost of keeping the mark updated.
<P>
<DL>
<DT><B>See Also: </B><DD><A HREF="../../../serialized-form.html#javax.swing.text.GapContent">Serialized Form</A></DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#GapContent()">GapContent</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new GapContent object.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#GapContent(int)">GapContent</A></B>(int&nbsp;initialLength)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new GapContent object, with the initial
 size specified.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#allocateArray(int)">allocateArray</A></B>(int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocate an array to store items of the type
 appropriate (which is determined by the subclass).</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/swing/text/Position.html">Position</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#createPosition(int)">createPosition</A></B>(int&nbsp;offset)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a position within the content that will
 track change as the content is mutated.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#getArrayLength()">getArrayLength</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the length of the allocated array.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#getChars(int, int, javax.swing.text.Segment)">getChars</A></B>(int&nbsp;where,
         int&nbsp;len,
         <A HREF="../../../javax/swing/text/Segment.html">Segment</A>&nbsp;chars)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a portion of the content.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.util.Vector</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#getPositionsInRange(java.util.Vector, int, int)">getPositionsInRange</A></B>(java.util.Vector&nbsp;v,
                    int&nbsp;offset,
                    int&nbsp;length)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a Vector containing instances of UndoPosRef for the
 Positions in the range
 <code>offset</code> to <code>offset</code> + <code>length</code>.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#getString(int, int)">getString</A></B>(int&nbsp;where,
          int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a portion of the content.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/swing/undo/UndoableEdit.html">UndoableEdit</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#insertString(int, java.lang.String)">insertString</A></B>(int&nbsp;where,
             java.lang.String&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts a string into the content.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#length()">length</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the length of the content.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/swing/undo/UndoableEdit.html">UndoableEdit</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#remove(int, int)">remove</A></B>(int&nbsp;where,
       int&nbsp;nitems)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes part of the content.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#resetMarksAtZero()">resetMarksAtZero</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resets all the marks that have an offset of 0 to have an index of
 zero as well.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#shiftEnd(int)">shiftEnd</A></B>(int&nbsp;newSize)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Make the gap bigger, moving any necessary data and updating 
 the appropriate marks</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#shiftGap(int)">shiftGap</A></B>(int&nbsp;newGapStart)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Move the start of the gap to a new location,
 without changing the size of the gap.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#shiftGapEndUp(int)">shiftGapEndUp</A></B>(int&nbsp;newGapEnd)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust the gap end upward.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#shiftGapStartDown(int)">shiftGapStartDown</A></B>(int&nbsp;newGapStart)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust the gap end downward.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/text/GapContent.html#updateUndoPositions(java.util.Vector, int, int)">updateUndoPositions</A></B>(java.util.Vector&nbsp;positions,
                    int&nbsp;offset,
                    int&nbsp;length)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resets the location for all the UndoPosRef instances
 in <code>positions</code>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.swing.text.GapVector"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.swing.text.GapVector</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>getArray, 
getGapEnd, 
getGapStart, 
replace</CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>clone, 
equals, 
finalize, 
getClass, 
hashCode, 
notify, 
notifyAll, 
toString, 
wait, 
wait, 
wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="GapContent()"><!-- --></A><H3>
GapContent</H3>
<PRE>
public <B>GapContent</B>()</PRE>
<DL>
<DD>Creates a new GapContent object.  Initial size defaults to 10.</DL>
<HR>

<A NAME="GapContent(int)"><!-- --></A><H3>
GapContent</H3>
<PRE>
public <B>GapContent</B>(int&nbsp;initialLength)</PRE>
<DL>
<DD>Creates a new GapContent object, with the initial
 size specified.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>initialLength</CODE> - the initial size</DL>
</DD>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="allocateArray(int)"><!-- --></A><H3>
allocateArray</H3>
<PRE>
protected java.lang.Object <B>allocateArray</B>(int&nbsp;len)</PRE>
<DL>
<DD>Allocate an array to store items of the type
 appropriate (which is determined by the subclass).<DD><DL>
<DT><B>Overrides:</B><DD>allocateArray in class javax.swing.text.GapVector</DL>
</DD>
</DL>
<HR>

<A NAME="getArrayLength()"><!-- --></A><H3>
getArrayLength</H3>
<PRE>
protected int <B>getArrayLength</B>()</PRE>
<DL>
<DD>Get the length of the allocated array.<DD><DL>
<DT><B>Overrides:</B><DD>getArrayLength in class javax.swing.text.GapVector</DL>
</DD>
</DL>
<HR>

<A NAME="length()"><!-- --></A><H3>
length</H3>
<PRE>
public int <B>length</B>()</PRE>
<DL>
<DD>Returns the length of the content.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#length()">length</A> in interface <A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A><DT><B>Returns:</B><DD>the length >= 1<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#length()"><CODE>AbstractDocument.Content.length()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="insertString(int, java.lang.String)"><!-- --></A><H3>
insertString</H3>
<PRE>
public <A HREF="../../../javax/swing/undo/UndoableEdit.html">UndoableEdit</A> <B>insertString</B>(int&nbsp;where,
                                 java.lang.String&nbsp;str)
                          throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE>
<DL>
<DD>Inserts a string into the content.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#insertString(int, java.lang.String)">insertString</A> in interface <A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A><DT><B>Parameters:</B><DD><CODE>where</CODE> - the starting position >= 0, < length()<DD><CODE>str</CODE> - the non-null string to insert<DT><B>Returns:</B><DD>an UndoableEdit object for undoing<DT><B>Throws:</B><DD><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A> - if the specified position is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#insertString(int, java.lang.String)"><CODE>AbstractDocument.Content.insertString(int, java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="remove(int, int)"><!-- --></A><H3>
remove</H3>
<PRE>
public <A HREF="../../../javax/swing/undo/UndoableEdit.html">UndoableEdit</A> <B>remove</B>(int&nbsp;where,
                           int&nbsp;nitems)
                    throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE>
<DL>
<DD>Removes part of the content.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#remove(int, int)">remove</A> in interface <A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A><DT><B>Parameters:</B><DD><CODE>where</CODE> - the starting position >= 0, where + nitems < length()<DD><CODE>nitems</CODE> - the number of characters to remove >= 0<DT><B>Returns:</B><DD>an UndoableEdit object for undoing<DT><B>Throws:</B><DD><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A> - if the specified position is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#remove(int, int)"><CODE>AbstractDocument.Content.remove(int, int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getString(int, int)"><!-- --></A><H3>
getString</H3>
<PRE>
public java.lang.String <B>getString</B>(int&nbsp;where,
                                  int&nbsp;len)
                           throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE>
<DL>
<DD>Retrieves a portion of the content.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#getString(int, int)">getString</A> in interface <A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A><DT><B>Parameters:</B><DD><CODE>where</CODE> - the starting position >= 0<DD><CODE>len</CODE> - the length to retrieve >= 0<DT><B>Returns:</B><DD>a string representing the content<DT><B>Throws:</B><DD><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A> - if the specified position is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#getString(int, int)"><CODE>AbstractDocument.Content.getString(int, int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getChars(int, int, javax.swing.text.Segment)"><!-- --></A><H3>
getChars</H3>
<PRE>
public void <B>getChars</B>(int&nbsp;where,
                     int&nbsp;len,
                     <A HREF="../../../javax/swing/text/Segment.html">Segment</A>&nbsp;chars)
              throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE>
<DL>
<DD>Retrieves a portion of the content.  If the desired content spans
 the gap, we copy the content.  If the desired content does not
 span the gap, the actual store is returned to avoid the copy since
 it is contiguous.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#getChars(int, int, javax.swing.text.Segment)">getChars</A> in interface <A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A><DT><B>Parameters:</B><DD><CODE>where</CODE> - the starting position >= 0, where + len <= length()<DD><CODE>len</CODE> - the number of characters to retrieve >= 0<DD><CODE>chars</CODE> - the Segment object to return the characters in<DT><B>Throws:</B><DD><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A> - if the specified position is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#getChars(int, int, javax.swing.text.Segment)"><CODE>AbstractDocument.Content.getChars(int, int, javax.swing.text.Segment)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="createPosition(int)"><!-- --></A><H3>
createPosition</H3>
<PRE>
public <A HREF="../../../javax/swing/text/Position.html">Position</A> <B>createPosition</B>(int&nbsp;offset)
                        throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE>
<DL>
<DD>Creates a position within the content that will
 track change as the content is mutated.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.Content.html#createPosition(int)">createPosition</A> in interface <A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A><DT><B>Parameters:</B><DD><CODE>offset</CODE> - the offset to track >= 0<DT><B>Returns:</B><DD>the position<DT><B>Throws:</B><DD><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A> - if the specified position is invalid</DL>
</DD>
</DL>
<HR>

<A NAME="shiftEnd(int)"><!-- --></A><H3>
shiftEnd</H3>
<PRE>
protected void <B>shiftEnd</B>(int&nbsp;newSize)</PRE>
<DL>
<DD>Make the gap bigger, moving any necessary data and updating 
 the appropriate marks<DD><DL>
<DT><B>Overrides:</B><DD>shiftEnd in class javax.swing.text.GapVector</DL>
</DD>
</DL>
<HR>

<A NAME="shiftGap(int)"><!-- --></A><H3>
shiftGap</H3>
<PRE>
protected void <B>shiftGap</B>(int&nbsp;newGapStart)</PRE>
<DL>
<DD>Move the start of the gap to a new location,
 without changing the size of the gap.  This 
 moves the data in the array and updates the
 marks accordingly.<DD><DL>
<DT><B>Overrides:</B><DD>shiftGap in class javax.swing.text.GapVector</DL>
</DD>
</DL>
<HR>

<A NAME="resetMarksAtZero()"><!-- --></A><H3>
resetMarksAtZero</H3>
<PRE>
protected void <B>resetMarksAtZero</B>()</PRE>
<DL>
<DD>Resets all the marks that have an offset of 0 to have an index of
 zero as well.<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="shiftGapStartDown(int)"><!-- --></A><H3>
shiftGapStartDown</H3>
<PRE>
protected void <B>shiftGapStartDown</B>(int&nbsp;newGapStart)</PRE>
<DL>
<DD>Adjust the gap end downward.  This doesn't move
 any data, but it does update any marks affected 
 by the boundry change.  All marks from the old
 gap start down to the new gap start are squeezed
 to the end of the gap (their location has been
 removed).<DD><DL>
<DT><B>Overrides:</B><DD>shiftGapStartDown in class javax.swing.text.GapVector</DL>
</DD>
</DL>
<HR>

<A NAME="shiftGapEndUp(int)"><!-- --></A><H3>
shiftGapEndUp</H3>
<PRE>
protected void <B>shiftGapEndUp</B>(int&nbsp;newGapEnd)</PRE>
<DL>
<DD>Adjust the gap end upward.  This doesn't move
 any data, but it does update any marks affected 
 by the boundry change. All marks from the old
 gap end up to the new gap end are squeezed
 to the end of the gap (their location has been
 removed).<DD><DL>
<DT><B>Overrides:</B><DD>shiftGapEndUp in class javax.swing.text.GapVector</DL>
</DD>
</DL>
<HR>

<A NAME="getPositionsInRange(java.util.Vector, int, int)"><!-- --></A><H3>
getPositionsInRange</H3>
<PRE>
protected java.util.Vector <B>getPositionsInRange</B>(java.util.Vector&nbsp;v,
                                               int&nbsp;offset,
                                               int&nbsp;length)</PRE>
<DL>
<DD>Returns a Vector containing instances of UndoPosRef for the
 Positions in the range
 <code>offset</code> to <code>offset</code> + <code>length</code>.
 If <code>v</code> is not null the matching Positions are placed in
 there. The vector with the resulting Positions are returned.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - the Vector to use, with a new one created on null<DD><CODE>offset</CODE> - the starting offset >= 0<DD><CODE>length</CODE> - the length >= 0<DT><B>Returns:</B><DD>the set of instances</DL>
</DD>
</DL>
<HR>

<A NAME="updateUndoPositions(java.util.Vector, int, int)"><!-- --></A><H3>
updateUndoPositions</H3>
<PRE>
protected void <B>updateUndoPositions</B>(java.util.Vector&nbsp;positions,
                                   int&nbsp;offset,
                                   int&nbsp;length)</PRE>
<DL>
<DD>Resets the location for all the UndoPosRef instances
 in <code>positions</code>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>positions</CODE> - the UndoPosRef instances to reset</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/GapContent.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Swing 1.1</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/swing/text/FieldView.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/swing/text/IconView.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="GapContent.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries.<br>Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>
