Moves the specified string to top. @param top entry to be moved to the top @return self reference
(final byte[] top)
| 84 | * @return self reference |
| 85 | */ |
| 86 | public Table toTop(final byte[] top) { |
| 87 | for(int i = 0; i < contents.size(); ++i) { |
| 88 | if(eq(top, contents.get(i).get(0))) { |
| 89 | contents.add(0, contents.remove(i)); |
| 90 | break; |
| 91 | } |
| 92 | } |
| 93 | return this; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Returns a textual representation of the table. |