提交 6c2381e7 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation

上级 4712d9f8
...@@ -780,8 +780,9 @@ In a GUI, or in an XML file, only one backslash is required: ...@@ -780,8 +780,9 @@ In a GUI, or in an XML file, only one backslash is required:
/> />
</pre> </pre>
<p> <p>
Backslashed within the init script (for example within a runscript statement, to specify the folder names in Windows) Backslashes within the init script (for example within a runscript statement, to specify the folder names in Windows)
would need to be escaped as well (using a backslash). It might be simpler to avoid backslashes in folder names for this reason. need to be escaped as well (using a second backslash). It might be simpler to avoid backslashes in folder names for this reason;
use forward slashes instead.
</p> </p>
<h2 id="ignore_unknown_settings">Ignore Unknown Settings</h2> <h2 id="ignore_unknown_settings">Ignore Unknown Settings</h2>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -698,4 +698,4 @@ minecraft videos youtube dataflyer bukkit alessio adamo jacopo angel leon frost ...@@ -698,4 +698,4 @@ minecraft videos youtube dataflyer bukkit alessio adamo jacopo angel leon frost
deserializing eckenfelder daniel serodio dirname semicolons whose stretch deserializing eckenfelder daniel serodio dirname semicolons whose stretch
stabilize succeeded widening optimise deprecate increasing leaning rotate git stabilize succeeded widening optimise deprecate increasing leaning rotate git
hub rewind spawn shimizu fumiyuki nelson github laird rollover millions hub rewind spawn shimizu fumiyuki nelson github laird rollover millions
ljnelson edugility ljnelson edugility sormula pushed backslashes slashes
\ No newline at end of file \ No newline at end of file
...@@ -32,8 +32,9 @@ class Page { ...@@ -32,8 +32,9 @@ class Page {
* Create a new page. * Create a new page.
* *
* @param map the map * @param map the map
* @param key the keys * @param keys the keys
* @param values the values * @param values the values
* @param children the children
* @return the page * @return the page
*/ */
static Page create(BtreeMap<?, ?> map, Object[] keys, Object[] values, long[] children) { static Page create(BtreeMap<?, ?> map, Object[] keys, Object[] values, long[] children) {
...@@ -111,6 +112,12 @@ class Page { ...@@ -111,6 +112,12 @@ class Page {
this.id = id; this.id = id;
} }
/**
* Get the value for the given key, or null if not found.
*
* @param key the key
* @return the value or null
*/
Object find(Object key) { Object find(Object key) {
int x = findKey(key); int x = findKey(key);
if (children != null) { if (children != null) {
...@@ -148,10 +155,25 @@ class Page { ...@@ -148,10 +155,25 @@ class Page {
* A position in a cursor * A position in a cursor
*/ */
static class CursorPos { static class CursorPos {
/**
* The current page.
*/
Page page; Page page;
/**
* The current index.
*/
int index; int index;
} }
/**
* Go to the first element for the given key.
*
* @param p the current page
* @param parents the stack of parent page positions
* @param key the key
*/
static void min(Page p, ArrayList<CursorPos> parents, Object key) { static void min(Page p, ArrayList<CursorPos> parents, Object key) {
int todo; int todo;
while (p != null) { while (p != null) {
...@@ -180,6 +202,12 @@ class Page { ...@@ -180,6 +202,12 @@ class Page {
} }
} }
/**
* Get the next key.
*
* @param parents the stack of parent page positions
* @return the next key
*/
public static Object nextKey(ArrayList<CursorPos> parents) { public static Object nextKey(ArrayList<CursorPos> parents) {
int todoTest; int todoTest;
if (parents.size() == 0) { if (parents.size() == 0) {
...@@ -390,7 +418,7 @@ class Page { ...@@ -390,7 +418,7 @@ class Page {
return p; return p;
} }
void insert(int index, Object key, Object value, long child) { private void insert(int index, Object key, Object value, long child) {
Object[] newKeys = new Object[keys.length + 1]; Object[] newKeys = new Object[keys.length + 1];
copyWithGap(keys, newKeys, keys.length, index); copyWithGap(keys, newKeys, keys.length, index);
newKeys[index] = key; newKeys[index] = key;
...@@ -409,7 +437,7 @@ class Page { ...@@ -409,7 +437,7 @@ class Page {
} }
} }
void remove(int index) { private void remove(int index) {
Object[] newKeys = new Object[keys.length - 1]; Object[] newKeys = new Object[keys.length - 1];
copyExcept(keys, newKeys, keys.length, index); copyExcept(keys, newKeys, keys.length, index);
keys = newKeys; keys = newKeys;
...@@ -493,10 +521,6 @@ class Page { ...@@ -493,10 +521,6 @@ class Page {
*/ */
int lengthIncludingTempChildren() { int lengthIncludingTempChildren() {
int len = length(); int len = length();
if (len > 1024) {
int test;
System.out.println("??");
}
if (children != null) { if (children != null) {
int size = children.length; int size = children.length;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
...@@ -509,6 +533,12 @@ if (len > 1024) { ...@@ -509,6 +533,12 @@ if (len > 1024) {
return len; return len;
} }
/**
* Update the page ids recursively.
*
* @param pageId the new page id
* @return the next page id
*/
long updatePageIds(long pageId) { long updatePageIds(long pageId) {
this.storedId = pageId; this.storedId = pageId;
pageId += length(); pageId += length();
...@@ -524,6 +554,12 @@ if (len > 1024) { ...@@ -524,6 +554,12 @@ if (len > 1024) {
return pageId; return pageId;
} }
/**
* Store this page.
*
* @param buff the target buffer
* @return the page id
*/
long storeTemp(ByteBuffer buff) { long storeTemp(ByteBuffer buff) {
write(buff); write(buff);
if (children != null) { if (children != null) {
...@@ -539,6 +575,11 @@ if (len > 1024) { ...@@ -539,6 +575,11 @@ if (len > 1024) {
return id; return id;
} }
/**
* Count the temporary pages recursively.
*
* @return the number of temporary pages
*/
int countTemp() { int countTemp() {
int count = 1; int count = 1;
if (children != null) { if (children != null) {
...@@ -598,8 +639,4 @@ if (len > 1024) { ...@@ -598,8 +639,4 @@ if (len > 1024) {
} }
} }
public Object getKey(int index) {
return keys[index];
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论