Java 类org.json.Kim 实例源码
项目:marathonv5
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:marathonv5
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register
// it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:marathonv5
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:marathonv5
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " + that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}
项目:encdroidMC
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:encdroidMC
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:encdroidMC
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:encdroidMC
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " +
that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}
项目:mohoo-wechat-card
文件:Zipper.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name The name string.
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
write(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff, this.namehuffext);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:perfcharts
文件:Zipper.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name The name string.
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
write(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff, this.namehuffext);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:equalize-xpi-modules
文件:Zipper.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name The name string.
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
write(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff, this.namehuffext);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:data-lawyer
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:data-lawyer
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:data-lawyer
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:data-lawyer
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " +
that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}
项目:nuevapartida
文件:Zipper.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name The name string.
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
write(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff, this.namehuffext);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:SDN-NDNFlow
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:SDN-NDNFlow
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:SDN-NDNFlow
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:SDN-NDNFlow
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " +
that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}
项目:jsendpraat
文件:Zipper.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name The name string.
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
write(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff, this.namehuffext);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:NewGui-for-Minecraft
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:NewGui-for-Minecraft
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:NewGui-for-Minecraft
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:NewGui-for-Minecraft
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " +
that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}
项目:NewGui-for-Minecraft
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:NewGui-for-Minecraft
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:NewGui-for-Minecraft
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:NewGui-for-Minecraft
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " +
that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}
项目:NewGui-for-Minecraft
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:NewGui-for-Minecraft
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:NewGui-for-Minecraft
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:NewGui-for-Minecraft
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " +
that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}
项目:GoodTime-Launcher-for-server
文件:Zipper.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name The name string.
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
write(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff, this.namehuffext);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:CMPUT391F
文件:Zipper.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name The name string.
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
write(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register it.
zero();
write(kim, this.namehuff, this.namehuffext);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:RipplePower
文件:Decompressor.java
private String readName() throws JSONException {
byte[] bytes = new byte[65536];
int length = 0;
if (!bit()) {
while (true) {
int c = this.namehuff.read(this.bitreader);
if (c == end) {
break;
}
bytes[length] = (byte) c;
length += 1;
}
if (length == 0) {
return "";
}
Kim kim = new Kim(bytes, length);
this.namekeep.register(kim);
return kim.toString();
}
return getAndTick(this.namekeep, this.bitreader).toString();
}
项目:RipplePower
文件:Compressor.java
/**
* Write the name of an object property. Names have their own Keep and
* Huffman encoder because they are expected to be a more restricted set.
*
* @param name
* @throws JSONException
*/
private void writeName(String name) throws JSONException {
// If this name has already been registered, then emit its integer and
// increment its usage count.
Kim kim = new Kim(name);
int integer = this.namekeep.find(kim);
if (integer != none) {
one();
writeAndTick(integer, this.namekeep);
} else {
// Otherwise, emit the string with Huffman encoding, and register
// it.
zero();
write(kim, this.namehuff);
write(end, namehuff);
this.namekeep.register(kim);
}
}
项目:preston
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:RipplePower
文件:TrieKeep.java
/**
* Find the integer value associated with this key, or nothing if this key
* is not in the keep.
*
* @param key
* An object.
* @return An integer
*/
public int match(Kim kim, int from, int thru) {
Node node = this.root;
int best = none;
for (int at = from; at < thru; at += 1) {
node = node.get(kim.get(at));
if (node == null) {
break;
}
if (node.integer != none) {
best = node.integer;
}
from += 1;
}
return best;
}
项目:RipplePower
文件:TrieKeep.java
public boolean postMortem(PostMortem pm) {
boolean result = true;
TrieKeep that = (TrieKeep) pm;
if (this.length != that.length) {
JSONzip.log("\nLength " + this.length + " <> " + that.length);
return false;
}
if (this.capacity != that.capacity) {
JSONzip.log("\nCapacity " + this.capacity + " <> " + that.capacity);
return false;
}
for (int i = 0; i < this.length; i += 1) {
Kim thiskim = this.kim(i);
Kim thatkim = that.kim(i);
if (!thiskim.equals(thatkim)) {
JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
result = false;
}
}
return result && this.root.postMortem(that.root);
}