• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Kim类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.json.Kim的典型用法代码示例。如果您正苦于以下问题:Java Kim类的具体用法?Java Kim怎么用?Java Kim使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Kim类属于org.json包,在下文中一共展示了Kim类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readName

import org.json.Kim; //导入依赖的package包/类
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();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:22,代码来源:Decompressor.java


示例2: writeName

import org.json.Kim; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:29,代码来源:Compressor.java


示例3: match

import org.json.Kim; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:TrieKeep.java


示例4: postMortem

import org.json.Kim; //导入依赖的package包/类
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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:22,代码来源:TrieKeep.java


示例5: writeName

import org.json.Kim; //导入依赖的package包/类
/**
     * 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);
        }
    }
 
开发者ID:starn,项目名称:encdroidMC,代码行数:28,代码来源:Compressor.java


示例6: match

import org.json.Kim; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:starn,项目名称:encdroidMC,代码行数:24,代码来源:TrieKeep.java


示例7: postMortem

import org.json.Kim; //导入依赖的package包/类
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);
}
 
开发者ID:starn,项目名称:encdroidMC,代码行数:23,代码来源:TrieKeep.java


示例8: writeName

import org.json.Kim; //导入依赖的package包/类
/**
     * 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);
        }
    }
 
开发者ID:mallog,项目名称:mohoo-wechat-card,代码行数:28,代码来源:Zipper.java


示例9: readName

import org.json.Kim; //导入依赖的package包/类
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();
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:22,代码来源:Decompressor.java


示例10: writeName

import org.json.Kim; //导入依赖的package包/类
/**
 * 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);
	}
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:29,代码来源:Compressor.java


示例11: match

import org.json.Kim; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:24,代码来源:TrieKeep.java


示例12: postMortem

import org.json.Kim; //导入依赖的package包/类
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);
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:22,代码来源:TrieKeep.java



注:本文中的org.json.Kim类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClearableCookieJar类代码示例发布时间:2022-05-21
下一篇:
Java Entities类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap