本文整理汇总了Java中org.andengine.util.adt.bit.ByteBackedBitVector类的典型用法代码示例。如果您正苦于以下问题:Java ByteBackedBitVector类的具体用法?Java ByteBackedBitVector怎么用?Java ByteBackedBitVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ByteBackedBitVector类属于org.andengine.util.adt.bit包,在下文中一共展示了ByteBackedBitVector类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Entries
import org.andengine.util.adt.bit.ByteBackedBitVector; //导入依赖的package包/类
public Entries(final ArrayList<Entry> pEntries, final String pString) {
this.mEntries = pEntries;
this.mString = pString;
int entryStartIndexMaximum = 0;
int entryLengthMaximum = 0;
for (final Entry entry : pEntries) {
entryStartIndexMaximum = Math.max(entryStartIndexMaximum, entry.mStartIndex);
entryLengthMaximum = Math.max(entryLengthMaximum, entry.mLength);
}
this.mEntryStartIndexMaximum = entryStartIndexMaximum;
this.mEntryLengthMaximum = entryLengthMaximum;
/* Determine all characters used. */
final IBitVector characterBitVector = new ByteBackedBitVector(Character.MAX_VALUE);
final int stringLength = pString.length();
for (int i = 0; i < stringLength; i++) {
characterBitVector.setBit(pString.charAt(i));
}
int characterCount = 0;
for (int i = 0; i < Character.MAX_VALUE; i++) {
if (characterBitVector.getBit(i) == BitVector.TRUE) {
characterCount++;
}
}
this.mCharacters = new char[characterCount];
characterCount = 0;
for (int i = 0; i < Character.MAX_VALUE; i++) {
if (characterBitVector.getBit(i) == BitVector.TRUE) {
this.mCharacters[characterCount++] = (char) i;
}
}
}
示例2: load
import org.andengine.util.adt.bit.ByteBackedBitVector; //导入依赖的package包/类
public static Dictionary load(final InputStream pInputStream) throws IOException {
return new Dictionary(ByteBackedBitVector.load(new DataInputStream(pInputStream)));
}