JavaTM 2
Platform
Std.  Ed.  v1. 4.0

javax.swing.text
Ŭ·¡½º GapContent

java.lang.Object 
  |
  +--javax.swing.text.GapVector
        |
        +--javax.swing.text.GapContent
¸ðµç ±¸Çö ÀÎÅÍÆäÀ̽º:
AbstractDocument.Content , Serializable

public class GapContent
extends javax.swing.text.GapVector
implements AbstractDocument.Content , Serializable

emacs °¡ »ç¿ëÇÏ´Â °Í °ú À¯»çÇÑ °¸ ÷ºÎ ¹öÆÛ¸¦ »ç¿ëÇØ ±¸ÇöµÈ AbstractDocument.Content ÀÎÅÍÆäÀ̽ºÀÇ ±¸ÇöÀÔ´Ï´Ù. ±â¾ïµÇ´Â ³»¿ëÀº ¾îµð¿£°¡ °¸À» °¡Áö´Â Unicode ij¸¯ÅÍ ¶óÀÎÀÇ ¹è¿­ÀÔ´Ï´Ù. °¸Àº º¯°æÀÇ À§Ä¡¿¡ À̵¿µÇ¹Ç·Î, ´ëºÎºÐÀÇ º¯°æÀÌ °°Àº À§Ä¡¿¡ ÀÖ´Â Àå¼Ò¿¡¼­, °øÅëÀÇ µ¿ÀÛÀ» ÀÌ¿ëÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù. °¸ °æ°è¿¡¼­ »ý±â´Â º¯°æÀº ÀϹÝÀûÀ¸·Î °£´ÜÇÑ °ÍÀ̹ǷÎ, ¹è¿­ÀÇ ³»¿ëÀ» Á÷Á¢ À̵¿ÇØ º¯°æÀ» Àû¿ëÇÏ´Â °Íº¸´Ùµµ °¸À» À̵¿ÇÏ´Â ÆíÀÌ ½Ã°£ÀÌ µéÁö ¾Ê½À´Ï´Ù.

¶Ç, º¯°æÀ» ÃßÀûÇÏ´Â À§Ä¡¸¦ °ü¸®ÇÏ´Â °Íµµ ÀϹÝÀûÀ¸·Î °£´ÜÇÕ´Ï´Ù. À§Ä¡ÀÇ ±¸Çö (¸¶Å©)Àº ¹è¿­ À妽º¸¦ ÀúÀåÇØ, ÇöÀçÀÇ °¸ À§Ä¡·ÎºÎÅÍ ¼ø¼­´ë·Î À§Ä¡¸¦ °£´ÜÇÏ°Ô °è»êÇÒ ¼ö ÀÖ½À´Ï´Ù. º¯°æ¿¡¼­´Â °¸ÀÇ À̵¿½Ã¿¡ ½Å±¸ °¸ °æ°è°£ÀÇ ¸¶Å©¿¡ ´ëÇÑ °»½ÅÀ» ÇÊ¿ä·Î ÇÒ »Ó(¸¸Å­)À̹ǷÎ, ¸¶Å©ÀÇ °»½ÅÀº ÀϹÝÀûÀ¸·Î ¸Å¿ì °£ÆíÇÕ´Ï´Ù. ¸¶Å©´Â ¼ÒÆ® µÈ »óÅ·ΠÀúÀåµÇ¹Ç·Î, 2 µîºÐ Ž»öÀ¸·Î Àçºü¸£°Ô ã¾Æ³¾ ¼ö ÀÖ½À´Ï´Ù. À̰ÍÀº ¸¶Å©¸¦ Ãß°¡ÇÏ´Â ¼ö°í¸¦ Áõ´ë½ÃŰ´Â ÇÑÆíÀ¸·Î, ¸¶Å©ÀÇ °»½ÅÀ» À¯ÁöÇÏ´Â ¼ö°í¸¦ ÁÙÀÔ´Ï´Ù.


»ý¼ºÀÚÀÇ °³¿ä
GapContent ()
          »õ·Î¿î GapContent ¿ÀºêÁ§Æ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù.
GapContent (int initialLength)
          ÁöÁ¤µÈ Ãʱ⠻çÀÌÁî·Î »õ·Î¿î GapContent ¿ÀºêÁ§Æ®¸¦ »ý¼ºÇÕ´Ï´Ù.
 
¸Þ¼ÒµåÀÇ °³¿ä
protected  Object allocateArray (int len)
          Ç׸ñÀ» ÀúÀåÇϱâ À§ÇÑ ÀûÀýÇÑ ÇüÅÂÀÇ ¹è¿­À» ÇÒ´çÇÕ´Ï´Ù.
 Position createPosition (int offset)
          ÄÁÅÙÃ÷°¡ º¯°æµÇ¾úÀ» ¶§¿¡ º¯°æÀ» ÃßÀûÇÏ´Â ÄÁÅÙÃ÷³»ÀÇ À§Ä¡¸¦ ÀÛ¼ºÇÕ´Ï´Ù.
protected  Object getArray ()
          Access to the array.
protected  int getArrayLength ()
          ÇÒ´çÇÒ ¼ö ÀÖ¾ú´ø ¹è¿­ÀÇ ±æÀ̸¦ µ¹·ÁÁÝ´Ï´Ù.
 void getChars (int where, int len, Segment  chars)
          ÄÁÅÙÃ÷ÀÇ ÀϺθ¦ ²¨³À´Ï´Ù.
protected  int getGapEnd ()
          Access to the end of the gap.
protected  int getGapStart ()
          Access to the start of the gap.
protected  Vector getPositionsInRange (Vector  v, int offset, int length)
          offset ~ offset + length ÀÇ ¹üÀ§¿¡ ÀÖ´Â À§Ä¡¿¡ ´ëÀÀÇÏ´Â UndoPosRef ÀÇ ÀνºÅϽº¸¦ Æ÷ÇÔÇÑ º¤Å͸¦ µ¹·ÁÁÝ´Ï´Ù.
 String getString (int where, int len)
          ÄÁÅÙÃ÷ÀÇ ÀϺθ¦ ²¨³À´Ï´Ù.
 UndoableEdit insertString (int where, String  str)
          ÄÁÅÙÃ÷¿¡ ij¸¯ÅÍ ¶óÀÎÀ» »ðÀÔÇÕ´Ï´Ù.
 int length ()
          ÄÁÅÙÃ÷ÀÇ ±æÀ̸¦ µ¹·ÁÁÝ´Ï´Ù.
 UndoableEdit remove (int where, int nitems)
          ÄÁÅÙÃ÷ÀÇ ÀϺθ¦ »èÁ¦ÇÕ´Ï´Ù.
protected  void replace (int position, int rmSize, Object  addItems, int addSize)
          Replace the given logical position in the storage with the given new items.
protected  void resetMarksAtZero ()
          ¿ÀÇÁ¼Â(offset)°¡ 0 ÀÇ ¸¶Å©¸¦ ¸ðµÎ ¸®¼ÂÆ® ÇØ, À妽ºµµ 0 ÀÌ µÇµµ·Ï(µíÀÌ) ÇÕ´Ï´Ù.
protected  void shiftEnd (int newSize)
          °¸À» È®´ëÇØ, À̰Ϳ¡ ÀÇÇØ, ÇÊ¿äÇÑ µ¥ÀÌÅ͸¦ À̵¿ÇØ ÀûÀýÇÑ ¸¶Å©¸¦ °»½ÅÇÕ´Ï´Ù.
protected  void shiftGap (int newGapStart)
          °¸ÀÇ °³½Ã À§Ä¡¸¦ »õ·Î¿î À§Ä¡·Î À̵¿ÇÕ´Ï´Ù.
protected  void shiftGapEndUp (int newGapEnd)
          °¸ÀÇ Á¾´ÜÀ» À­ÂÊ¿¡ Á¶ÀýÇÕ´Ï´Ù.
protected  void shiftGapStartDown (int newGapStart)
          °¸ÀÇ Á¾´ÜÀ» ÇϺο¡ Á¶ÀýÇÕ´Ï´Ù.
protected  void updateUndoPositions (Vector  positions, int offset, int length)
          positions ÀÇ ¸ðµç UndoPosRef ÀνºÅϽºÀÇ À§Ä¡¸¦ ¸®¼ÂÆ® ÇÕ´Ï´Ù.
 
Ŭ·¡½º java.lang. Object ¿¡¼­ »ó¼Ó¹ÞÀº ¸Þ¼Òµå
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

»ý¼ºÀÚÀÇ »ó¼¼

GapContent

public GapContent()
»õ·Î¿î GapContent ¿ÀºêÁ§Æ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. Ãʱ⠻çÀÌÁîÀÇ µðÆúÆ® °ªÀº 10 ÀÔ´Ï´Ù.


GapContent

public GapContent(int initialLength)
ÁöÁ¤µÈ Ãʱ⠻çÀÌÁî·Î »õ·Î¿î GapContent ¿ÀºêÁ§Æ®¸¦ »ý¼ºÇÕ´Ï´Ù. Ãʱ⠻çÀÌÁî´Â ¾Ï¹¬ÀÇ ºê·¹ÀÌÅ©¿Í °¸ÀÇ ¿©Áö¸¦ °®°ÔÇϱâ (À§ÇØ)¶§¹®¿¡, 2 ÀÌ»óÀÇ °ªÀ¸·Î ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
initialLength - Ãʱ⠻çÀÌÁî
¸Þ¼ÒµåÀÇ »ó¼¼

allocateArray

protected Object  allocateArray(int len)
Ç׸ñÀ» ÀúÀåÇϱâ À§ÇÑ ÀûÀýÇÑ ÇüÅÂÀÇ ¹è¿­À» ÇÒ´çÇÕ´Ï´Ù. ¹è¿­ÀÇ ÇüÅ´ ¼­ºê Ŭ·¡½º¿¡¼­ °áÁ¤ÇÕ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º javax.swing.text.GapVector ³»ÀÇ allocateArray

getArrayLength

protected int getArrayLength()
ÇÒ´çÇÒ ¼ö ÀÖ¾ú´ø ¹è¿­ÀÇ ±æÀ̸¦ µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
Ŭ·¡½º javax.swing.text.GapVector ³»ÀÇ getArrayLength

length

public int length()
ÄÁÅÙÃ÷ÀÇ ±æÀ̸¦ µ¹·ÁÁÝ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º AbstractDocument.Content ³»ÀÇ length
¹Ýȯ°ª:
±æÀÌ >= 1
°ü·Ã Ç׸ñ:
AbstractDocument.Content.length()

insertString

public UndoableEdit  insertString(int where,
                                 String  str)
                          throws BadLocationException 
ÄÁÅÙÃ÷¿¡ ij¸¯ÅÍ ¶óÀÎÀ» »ðÀÔÇÕ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º AbstractDocument.Content ³»ÀÇ insertString
ÆÄ¶ó¹ÌÅÍ:
where - °³½Ã À§Ä¡ >= 0,< length()
str - »ðÀÔÇÏ´Â null ÀÌ¿ÜÀÇ Ä³¸¯ÅÍ ¶óÀÎ
¹Ýȯ°ª:
¹ÙÅÁÀ¸·Î µÇµ¹¸®±â À§ÇÑ UndoableEdit ¿ÀºêÁ§Æ®
¿¹¿Ü:
BadLocationException - ÁöÁ¤µÈ À§Ä¡°¡ ¹«È¿ÀÎ °æ¿ì
°ü·Ã Ç׸ñ:
AbstractDocument.Content.insertString(int, java.lang.String)

remove

public UndoableEdit  remove(int where,
                           int nitems)
                    throws BadLocationException 
ÄÁÅÙÃ÷ÀÇ ÀϺθ¦ »èÁ¦ÇÕ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º AbstractDocument.Content ³»ÀÇ remove
ÆÄ¶ó¹ÌÅÍ:
where - °³½Ã À§Ä¡ >= 0, where + nitems < length()
nitems - »èÁ¦ ´ë»óÀÇ Ä³¸¯Åͼö >= 0
¹Ýȯ°ª:
¹ÙÅÁÀ¸·Î µÇµ¹¸®±â À§ÇÑ UndoableEdit ¿ÀºêÁ§Æ®
¿¹¿Ü:
BadLocationException - ÁöÁ¤µÈ À§Ä¡°¡ ¹«È¿ÀÎ °æ¿ì
°ü·Ã Ç׸ñ:
AbstractDocument.Content.remove(int, int)

getString

public String  getString(int where,
                        int len)
                 throws BadLocationException 
ÄÁÅÙÃ÷ÀÇ ÀϺθ¦ ²¨³À´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º AbstractDocument.Content ³»ÀÇ getString
ÆÄ¶ó¹ÌÅÍ:
where - °³½Ã À§Ä¡ >= 0
len - ²¨³»´Â ±æÀÌ >= 0
¹Ýȯ°ª:
ÄÁÅÙÃ÷¸¦ ³ªÅ¸³»´Â ij¸¯ÅÍ ¶óÀÎ
¿¹¿Ü:
BadLocationException - ÁöÁ¤µÈ À§Ä¡°¡ ¹«È¿ÀÎ °æ¿ì
°ü·Ã Ç׸ñ:
AbstractDocument.Content.getString(int, int)

getChars

public void getChars(int where,
                     int len,
                     Segment  chars)
              throws BadLocationException 
ÄÁÅÙÃ÷ÀÇ ÀϺθ¦ ²¨³À´Ï´Ù. ÇÊ¿äÇÑ ÄÁÅÙÃ÷°¡ °¸À» ¶Ç ÀÖ°í·Î ÀÖ´Â °æ¿ì, ÄÁÅÙÃ÷¸¦ Ä«ÇÇÇÕ´Ï´Ù. ÇÊ¿äÇÑ ÄÁÅÙÃ÷°¡ °¸À» ¶Ç ÀÖ°í·Î ¾ø´Â °æ¿ì, Ä«ÇÇ´Â ¿¬¼ÓÇϰí ÀÖ´Â °ÍÀ̹ǷÎ, ½ÇÁ¦ÀÇ ÀúÀå ³»¿ëÀ» µ¹·ÁÁÖ¾î Ä«ÇǸ¦ ÇÇÇÕ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º AbstractDocument.Content ³»ÀÇ getChars
ÆÄ¶ó¹ÌÅÍ:
where - °³½Ã À§Ä¡ >= 0. ¿©±â¼­ + len <= length()
len - °Ë»ö ´ë»óÀÇ Ä³¸¯Åͼö >= 0
chars - ij¸¯Å͸¦ µ¹·ÁÁÖ´Â ¾ÕÀÇ Segment ¿ÀºêÁ§Æ®
¿¹¿Ü:
BadLocationException - ÁöÁ¤µÈ À§Ä¡°¡ ¹«È¿ÀÎ °æ¿ì
°ü·Ã Ç׸ñ:
AbstractDocument.Content.getChars(int, int, javax.swing.text.Segment)

createPosition

public Position  createPosition(int offset)
                        throws BadLocationException 
ÄÁÅÙÃ÷°¡ º¯°æµÇ¾úÀ» ¶§¿¡ º¯°æÀ» ÃßÀûÇÏ´Â ÄÁÅÙÃ÷³»ÀÇ À§Ä¡¸¦ ÀÛ¼ºÇÕ´Ï´Ù.

Á¤ÀÇ:
ÀÎÅÍÆäÀ̽º AbstractDocument.Content ³»ÀÇ createPosition
ÆÄ¶ó¹ÌÅÍ:
offset - ÃßÀû ´ë»óÀÇ ¿ÀÇÁ¼Â(offset) >= 0
¹Ýȯ°ª:
À§Ä¡
¿¹¿Ü:
BadLocationException - ÁöÁ¤µÈ À§Ä¡°¡ ¹«È¿ÀÎ °æ¿ì

shiftEnd

protected void shiftEnd(int newSize)
°¸À» È®´ëÇØ, À̰Ϳ¡ ÀÇÇØ, ÇÊ¿äÇÑ µ¥ÀÌÅ͸¦ À̵¿ÇØ ÀûÀýÇÑ ¸¶Å©¸¦ °»½ÅÇÕ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º javax.swing.text.GapVector ³»ÀÇ shiftEnd

shiftGap

protected void shiftGap(int newGapStart)
°¸ÀÇ °³½Ã À§Ä¡¸¦ »õ·Î¿î À§Ä¡·Î À̵¿ÇÕ´Ï´Ù. ÀÌ ¶§, °¸ÀÇ »çÀÌÁî´Â º¯°æÇÏÁö ¾Ê½À´Ï´Ù. À̰Ϳ¡ ÀÇÇØ, ¹è¿­³»ÀÇ µ¥ÀÌÅÍ´Â À̵¿µÇ¾î ¸¶Å©´Â °»½ÅµË´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º javax.swing.text.GapVector ³»ÀÇ shiftGap

resetMarksAtZero

protected void resetMarksAtZero()
¿ÀÇÁ¼Â(offset)°¡ 0 ÀÇ ¸¶Å©¸¦ ¸ðµÎ ¸®¼ÂÆ® ÇØ, À妽ºµµ 0 ÀÌ µÇµµ·Ï(µíÀÌ) ÇÕ´Ï´Ù.


shiftGapStartDown

protected void shiftGapStartDown(int newGapStart)
°¸ÀÇ Á¾´ÜÀ» ÇϺο¡ Á¶ÀýÇÕ´Ï´Ù. ÀÌ Á¶ÀÛ¿¡¼­´Â µ¥ÀÌÅÍ´Â À̵¿µË´Ï´Ù¸¸, °æ°èÀÇ º¯°æ¿¡ ÀÇÇØ ¿µÇâÀ» ¹Þ´Â ¸ðµç ¸¶Å©°¡ °»½ÅµË´Ï´Ù. ³°Àº °¸ÀÇ °³½Ã À§Ä¡¿Í »õ·Î¿î °¸ÀÇ °³½Ã À§Ä¡µ¿¾È¿¡ ÀÖ´Â ¸ðµç ¸¶Å©´Â °¸ÀÇ Á¾´Ü¿¡ ¹Ð¾î³Ö¾îÁ® ±×·¯ÇÑ À§Ä¡´Â »èÁ¦µË´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º javax.swing.text.GapVector ³»ÀÇ shiftGapStartDown

shiftGapEndUp

protected void shiftGapEndUp(int newGapEnd)
°¸ÀÇ Á¾´ÜÀ» À­ÂÊ¿¡ Á¶ÀýÇÕ´Ï´Ù. ÀÌ Á¶ÀÛ¿¡¼­´Â µ¥ÀÌÅÍ´Â À̵¿µË´Ï´Ù¸¸, °æ°èÀÇ º¯°æ¿¡ ÀÇÇØ ¿µÇâÀ» ¹Þ´Â ¸ðµç ¸¶Å©°¡ °»½ÅµË´Ï´Ù. ³°Àº °¸ÀÇ Á¾·á À§Ä¡¿Í »õ·Î¿î °¸ÀÇ Á¾·á À§Ä¡µ¿¾È¿¡ ÀÖ´Â ¸ðµç ¸¶Å©´Â °¸ÀÇ Á¾´Ü¿¡ ¹Ð¾î³Ö¾îÁ® ±×·¯ÇÑ À§Ä¡´Â »èÁ¦µË´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º javax.swing.text.GapVector ³»ÀÇ shiftGapEndUp

getPositionsInRange

protected Vector  getPositionsInRange(Vector  v,
                                     int offset,
                                     int length)
offset ~ offset + length ÀÇ ¹üÀ§¿¡ ÀÖ´Â À§Ä¡¿¡ ´ëÀÀÇÏ´Â UndoPosRef ÀÇ ÀνºÅϽº¸¦ Æ÷ÇÔÇÑ º¤Å͸¦ µ¹·ÁÁÝ´Ï´Ù. v °¡ null °¡ ¾Æ´Ñ °æ¿ì, ÀÏÄ¡ÇÏ´Â À§Ä¡°¡ °Å±â¿¡ ¹èÄ¡µË´Ï´Ù. °á°úÀÇ À§Ä¡¸¦ °¡Áö´Â º¤ÅͰ¡ µ¹·ÁÁÖ¾îÁý´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
v - »ç¿ëÇÏ´Â º¤ÅÍ. null ÀÇ °æ¿ì´Â »õ·Î¿î º¤ÅͰ¡ ÀÛ¼ºµÇ´Â
offset - °³½Ã ¿ÀÇÁ¼Â(offset) >= 0
length - ±æÀÌ >= 0
¹Ýȯ°ª:
ÀνºÅϽº¼¼Æ®

updateUndoPositions

protected void updateUndoPositions(Vector  positions,
                                   int offset,
                                   int length)
positions ÀÇ ¸ðµç UndoPosRef ÀνºÅϽºÀÇ À§Ä¡¸¦ ¸®¼ÂÆ® ÇÕ´Ï´Ù.

À̰ÍÀº ³»ºÎ¿¡¼­ÀÇ »ç¿ëÀ» ¸ñÀûÀ¸·Î Çϰí ÀÖ¾î, ÀϹÝÀûÀ¸·Î´Â ¼­ºê Ŭ·¡½º¸¦ ´ë»óÀ¸·Î Çϰí ÀÖÁö ¾Ê½À´Ï´Ù.

ÆÄ¶ó¹ÌÅÍ:
positions - ¸®¼ÂÆ® ´ë»óÀÇ UndoPosRef ÀÇ ÀνºÅϽº

getArray

protected final Object  getArray()
Access to the array. The actual type of the array is known only by the subclass.


getGapStart

protected final int getGapStart()
Access to the start of the gap.


getGapEnd

protected final int getGapEnd()
Access to the end of the gap.


replace

protected void replace(int position,
                       int rmSize,
                       Object  addItems,
                       int addSize)
Replace the given logical position in the storage with the given new items. This will move the gap to the area being changed if the gap is not currently located at the change location.

ÆÄ¶ó¹ÌÅÍ:
position - the location to make the replacement. This is not the location in the underlying storage array, but the location in the contiguous space being modeled.
rmSize - the number of items to remove
addItems - the new items to place in storage.

JavaTM 2
Platform
Std.  Ed.  v1. 4.0

¹ö±×ÀÇ º¸°í¿Í ±â´ÉÀÇ ¸®Äù½ºÆ®
ÀÌ¿ÜÀÇ API ·¹ÆÛ·±½º ¹× °³¹ßÀÚ¿ë ¹®¼­¿¡ ´ëÇØ¼­´Â Java 2 SDK SE °³¹ßÀÚ¿ë ¹®¼­¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä. °³¹ßÀÚÀü¿ëÀÇ »ó¼¼ÇÑ ÇØ¼³, °³³äÀÇ °³¿ä, ¿ë¾îÀÇ Á¤ÀÇ, ¹ö±×ÀÇ È¸ÇÇÃ¥, ¹× ÄÚµå ½Ç·Ê°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù.

Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ À־ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.