equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2002-2013, the original author or authors. |
2 * Copyright (c) 2002-2016, the original author or authors. |
3 * |
3 * |
4 * This software is distributable under the BSD license. See the terms of the |
4 * This software is distributable under the BSD license. See the terms of the |
5 * BSD license in the documentation provided with this software. |
5 * BSD license in the documentation provided with this software. |
6 * |
6 * |
7 * http://www.opensource.org/licenses/bsd-license.php |
7 * http://www.opensource.org/licenses/bsd-license.php |
36 public KillRing(int size) { |
36 public KillRing(int size) { |
37 slots = new String[size]; |
37 slots = new String[size]; |
38 } |
38 } |
39 |
39 |
40 /** |
40 /** |
41 * Creates a new kill ring of the default size. {@see DEFAULT_SIZE}. |
41 * Creates a new kill ring of the default size. See {@link #DEFAULT_SIZE}. |
42 */ |
42 */ |
43 public KillRing() { |
43 public KillRing() { |
44 this(DEFAULT_SIZE); |
44 this(DEFAULT_SIZE); |
45 } |
45 } |
46 |
46 |
150 * backwards until one with not null content is found. |
150 * backwards until one with not null content is found. |
151 */ |
151 */ |
152 private void prev() { |
152 private void prev() { |
153 head--; |
153 head--; |
154 if (head == -1) { |
154 if (head == -1) { |
155 int x = (slots.length - 1); |
155 int x = slots.length - 1; |
156 for (; x >= 0; x--) { |
156 for (; x >= 0; x--) { |
157 if (slots[x] != null) { |
157 if (slots[x] != null) { |
158 break; |
158 break; |
159 } |
159 } |
160 } |
160 } |