站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

GapStart (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Interface GapStart


public interface GapStart

A given object can publish this interface if it allows an efficient access to its gap-based data storage and wants to give its clients a hint about how to access the data efficiently.

For example Document instance having gap-based document content can allow to get an instance of GapStart as a property:

      GapStart gs = (GapStart)doc.getProperty(GapStart.class);
      int gapStart = gs.getGapStart();
 
 Once the start of the gap is known the client can optimize
 access to the document's data. For example if the client
 does not care about the chunks in which it gets the document's data
 it can access the characters so that no character copying is done:
      Segment text = new Segment();
      doc.getText(0, gapStart, text); // document's data below gap
      ...
      doc.getText(gapStart, doc.getLength(), text); // document's data over gap
      ...
 


Method Summary
 int getGapStart()
          Get the begining of the gap in the object's gap-based data.
 

Method Detail

getGapStart

int getGapStart()
Get the begining of the gap in the object's gap-based data.

Returns:
>=0 and <= total size of the data of the object.

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.