本文整理汇总了Java中io.github.htools.collection.ArrayMap类的典型用法代码示例。如果您正苦于以下问题:Java ArrayMap类的具体用法?Java ArrayMap怎么用?Java ArrayMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArrayMap类属于io.github.htools.collection包,在下文中一共展示了ArrayMap类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: list
import io.github.htools.collection.ArrayMap; //导入依赖的package包/类
public static void list(ModelSpeed f, String settings[]) {
f.openRead();
ArrayMap<Integer, String> sorted = new ArrayMap();
NOTOK:
for (Record r : f.getKeys()) {
String qid = PrintTools.sprintf("%.6f", r.time);
if (settings != null) {
OK:
for (String s : settings) {
if (s.equals(Integer.toString(r.query))) {
continue OK;
}
if (s.equals(r.strategy))
continue OK;
}
continue NOTOK;
}
sorted.add(r.query, r.time + " " + r.strategy);
}
for (Map.Entry<Integer,String> e : sorted.ascending()) {
log.printf("%03d %s", e.getKey(), e.getValue());
}
}
示例2: readFields
import io.github.htools.collection.ArrayMap; //导入依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
BufferReaderWriter reader = new BufferReaderWriter(in);
hosts = reader.readStringArray();
int listsize = reader.readInt();
list = new ArrayMap();
log.info("readFields %s %d", hosts, listsize);
for (int q = 0; q < listsize; q++) {
list.add(readKey(reader), readValue(reader));
}
}
示例3: Translator
import io.github.htools.collection.ArrayMap; //导入依赖的package包/类
public Translator(Extractor extractor, String process) {
super(extractor, process);
ArrayMap<byte[], byte[]> searchReplace = initSearchReplace();
for (Map.Entry<byte[], byte[]> entry : searchReplace) {
byte[] search = entry.getKey();
byte[] replace = entry.getValue();
if (translations[search[0] & 0xff] == null) {
translations[search[0] & 0xff] = new ArrayMap();
}
translations[search[0] & 0xff].add(entry);
}
// log.info("translate\n%s", ArrayTools.toString(translate));
// log.info("search\n%s", ArrayTools.toString(search));
// log.info("replace\n%s", ArrayTools.toString(replace));
}
示例4: initSearchReplace
import io.github.htools.collection.ArrayMap; //导入依赖的package包/类
protected ArrayMap<byte[], byte[]> initSearchReplace() {
ArrayMap<byte[], byte[]> searchReplace = new ArrayMap();
for (int i = 0; i < StrTools.asciiextendedbyte.length; i++) {
byte search[] = new byte[1];
byte replace[] = new byte[1];
search[0] = StrTools.asciiextendedbyte[i];
replace[0] = StrTools.asciibyte[i];
searchReplace.add(search, replace);
}
return searchReplace;
}
示例5: ConvertUnicodeDiacritics
import io.github.htools.collection.ArrayMap; //导入依赖的package包/类
public ConvertUnicodeDiacritics(Extractor extractor, String process) {
super(extractor, process);
ArrayMap<byte[], byte[]> b = translations[0xC3];
// for (Map.Entry<byte[], byte[]> entry : b) {
// log.printf("%s%s", PrintTools.memoryDump(entry.getKey()), PrintTools.memoryDump(entry.getValue()));
// }
}
示例6: add
import io.github.htools.collection.ArrayMap; //导入依赖的package包/类
private void add(ArrayMap<byte[], byte[]> searchReplace, String search, String replace) {
byte[] s = ByteTools.toBytes(search);
byte[] r1 = ByteTools.toBytes(replace);
if (r1.length == s.length)
searchReplace.add(s, r1);
else {
byte[] r = new byte[s.length];
System.arraycopy(r1, 0, r, 0, r1.length);
searchReplace.add(s, r);
}
}
示例7: initSearchReplace
import io.github.htools.collection.ArrayMap; //导入依赖的package包/类
protected abstract ArrayMap<byte[], byte[]> initSearchReplace();