Add comments about how to calculate parent and children addresses.

Change-Id: Idf37d9a08a7b464a14c8755bedb755005e49ba33
main
Yuichiro Hanada 2013-09-05 11:50:13 +09:00
parent 91486bdb3d
commit 663f5375d1
1 changed files with 16 additions and 13 deletions

View File

@ -112,8 +112,10 @@ public final class FormatSpec {
* e | 1 byte = bbbbbbbb match * e | 1 byte = bbbbbbbb match
* n | case 1xxxxxxx => -((0xxxxxxx << 16) + (next byte << 8) + next byte) * n | case 1xxxxxxx => -((0xxxxxxx << 16) + (next byte << 8) + next byte)
* t | otherwise => (bbbbbbbb << 16) + (next byte << 8) + next byte * t | otherwise => (bbbbbbbb << 16) + (next byte << 8) + next byte
* a | * a | This address is relative to the head of the PtNode.
* ddress * d | If the node doesn't have a parent, this field is set to 0.
* d |
* ress
* *
* c | IF FLAG_HAS_MULTIPLE_CHARS * c | IF FLAG_HAS_MULTIPLE_CHARS
* h | char, char, char, char n * (1 or 3 bytes) : use PtNodeInfo for i/o helpers * h | char, char, char, char n * (1 or 3 bytes) : use PtNodeInfo for i/o helpers
@ -132,17 +134,18 @@ public final class FormatSpec {
* i | 1 byte = bbbbbbbb match * i | 1 byte = bbbbbbbb match
* l | case 1xxxxxxx => -((0xxxxxxx << 16) + (next byte << 8) + next byte) * l | case 1xxxxxxx => -((0xxxxxxx << 16) + (next byte << 8) + next byte)
* d | otherwise => (bbbbbbbb<<16) + (next byte << 8) + next byte * d | otherwise => (bbbbbbbb<<16) + (next byte << 8) + next byte
* r | ELSIF 00 = FLAG_CHILDREN_ADDRESS_TYPE_NOADDRESS == addressType * r | if this node doesn't have children, this field is set to 0.
* e | // nothing * e | (see BinaryDictEncoderUtils#writeVariableSignedAddress)
* n | ELSIF 01 = FLAG_CHILDREN_ADDRESS_TYPE_ONEBYTE == addressType * n | ELSIF 00 = FLAG_CHILDREN_ADDRESS_TYPE_NOADDRESS == addressType
* A | children address, 1 byte * a | // nothing
* d | ELSIF 10 = FLAG_CHILDREN_ADDRESS_TYPE_TWOBYTES == addressType * d | ELSIF 01 = FLAG_CHILDREN_ADDRESS_TYPE_ONEBYTE == addressType
* d | children address, 2 bytes * d | children address, 1 byte
* r | ELSE // 11 = FLAG_CHILDREN_ADDRESS_TYPE_THREEBYTES = addressType * r | ELSIF 10 = FLAG_CHILDREN_ADDRESS_TYPE_TWOBYTES == addressType
* e | children address, 3 bytes * e | children address, 2 bytes
* s | END * s | ELSE // 11 = FLAG_CHILDREN_ADDRESS_TYPE_THREEBYTES = addressType
* s * s | children address, 3 bytes
* ress * | END
* | This address is relative to the position of this field.
* *
* | IF FLAG_IS_TERMINAL && FLAG_HAS_SHORTCUT_TARGETS * | IF FLAG_IS_TERMINAL && FLAG_HAS_SHORTCUT_TARGETS
* | shortcut string list * | shortcut string list