< prev index next >

jdk/src/jdk.jline/share/classes/jdk/internal/jline/console/KillRing.java

Print this page


   1 /*
   2  * Copyright (c) 2002-2013, the original author or authors.
   3  *
   4  * This software is distributable under the BSD license. See the terms of the
   5  * BSD license in the documentation provided with this software.
   6  *
   7  * http://www.opensource.org/licenses/bsd-license.php
   8  */
   9 package jline.console;
  10 
  11 /**
  12  * The kill ring class keeps killed text in a fixed size ring. In this
  13  * class we also keep record of whether or not the last command was a
  14  * kill or a yank. Depending on this, the class may behave
  15  * different. For instance, two consecutive kill-word commands fill
  16  * the same slot such that the next yank will return the two
  17  * previously killed words instead that only the last one. Likewise
  18  * yank pop requires that the previous command was either a yank or a
  19  * yank-pop.
  20  */
  21 public final class KillRing {
  22 
  23     /**
  24      * Default size is 60, like in emacs.
  25      */
  26     private static final int DEFAULT_SIZE = 60;
  27 
  28     private final String[] slots;
  29     private int head = 0;


   1 /*
   2  * Copyright (c) 2002-2013, the original author or authors.
   3  *
   4  * This software is distributable under the BSD license. See the terms of the
   5  * BSD license in the documentation provided with this software.
   6  *
   7  * http://www.opensource.org/licenses/bsd-license.php
   8  */
   9 package jdk.internal.jline.console;
  10 
  11 /**
  12  * The kill ring class keeps killed text in a fixed size ring. In this
  13  * class we also keep record of whether or not the last command was a
  14  * kill or a yank. Depending on this, the class may behave
  15  * different. For instance, two consecutive kill-word commands fill
  16  * the same slot such that the next yank will return the two
  17  * previously killed words instead that only the last one. Likewise
  18  * yank pop requires that the previous command was either a yank or a
  19  * yank-pop.
  20  */
  21 public final class KillRing {
  22 
  23     /**
  24      * Default size is 60, like in emacs.
  25      */
  26     private static final int DEFAULT_SIZE = 60;
  27 
  28     private final String[] slots;
  29     private int head = 0;


< prev index next >