MCPcopy Create free account
hub / github.com/BaseXdb/basex / toTop

Method toTop

basex-core/src/main/java/org/basex/util/Table.java:86–94  ·  view source on GitHub ↗

Moves the specified string to top. @param top entry to be moved to the top @return self reference

(final byte[] top)

Source from the content-addressed store, hash-verified

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.

Callers 1

infoMethod · 0.80

Calls 5

sizeMethod · 0.65
eqMethod · 0.65
getMethod · 0.65
addMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected