public int isOneChar() { if (isNot()) return -1; int c = -1; if (mbuf != null) { int[]range = mbuf.getCodeRange(); c = range[1]; if (range[0] == 1 && c == range[2]) { if (c < BitSet.SINGLE_BYTE_SIZE && bs.at(c)) { c = -1; } } else { return -1; } } for (int i = 0; i < BitSet.BITSET_SIZE; i++) { int b1 = bs.bits[i]; if (b1 != 0) { if ((b1 & (b1 - 1)) == 0 && c == -1) { c = BitSet.BITS_IN_ROOM * i + Integer.bitCount(b1 - 1); } else { return -1; } } } return c; }
public int isOneChar() { if (isNot()) return -1; int c = -1; if (mbuf != null) { int[]range = mbuf.getCodeRange(); c = range[1]; if (range[0] == 1 && c == range[2]) { if (c < BitSet.SINGLE_BYTE_SIZE && bs.at(c)) { c = -1; } } else { return -1; } } for (int i = 0; i < BitSet.BITSET_SIZE; i++) { int b1 = bs.bits[i]; if (b1 != 0) { if ((b1 & (b1 - 1)) == 0 && c == -1) { c = BitSet.BITS_IN_ROOM * i + Integer.bitCount(b1 - 1); } else { return -1; } } } return c; }
boolean isCodeInCCLength(int encLength, int code) { boolean found; if (encLength > 1 || code >= BitSet.SINGLE_BYTE_SIZE) { if (mbuf == null) { found = false; } else { found = CodeRange.isInCodeRange(mbuf.getCodeRange(), code); } } else { found = bs.at(code); } if (isNot()) { return !found; } else { return found; } }
boolean isCodeInCCLength(int encLength, int code) { boolean found; if (encLength > 1 || code >= BitSet.SINGLE_BYTE_SIZE) { if (mbuf == null) { found = false; } else { found = CodeRange.isInCodeRange(mbuf.getCodeRange(), code); } } else { found = bs.at(code); } if (isNot()) { return !found; } else { return found; } }
private void addMultiByteCClass(CodeRangeBuffer mbuf) { addLength(mbuf.getUsed()); addInts(mbuf.getCodeRange(), mbuf.getUsed()); }
private void addMultiByteCClass(CodeRangeBuffer mbuf) { addLength(mbuf.getUsed()); addInts(mbuf.getCodeRange(), mbuf.getUsed()); }