static int positionValue(Encoding enc, int i) { if (i < ByteValTable.length) { if (i == 0 && enc.minLength() > 1) { return 20; } else { return ByteValTable[i]; } } else { return 4; /* Take it easy. */ } }
static int positionValue(Encoding enc, int i) { if (i < ByteValTable.length) { if (i == 0 && enc.minLength() > 1) { return 20; } else { return ByteValTable[i]; } } else { return 4; /* Take it easy. */ } }
public static int encMbminlen(Encoding encoding) { return encoding.minLength(); }
public static int encMbminlen(Encoding encoding) { return encoding.minLength(); }
private static int mbcodeStartPosition(Encoding enc) { return enc.minLength() > 1 ? 0 : 0x80; }
public static int encMbminlen(Encoding encoding) { return encoding.minLength(); }
private static int mbcodeStartPosition(Encoding enc) { return enc.minLength() > 1 ? 0 : 0x80; }
public static long strLengthWithCodeRange(Encoding enc, byte[]bytes, int p, int end) { if (enc.isFixedWidth()) { return (end - p + enc.minLength() - 1) / enc.minLength(); } else if (enc.isAsciiCompatible()) { return strLengthWithCodeRangeAsciiCompatible(enc, bytes, p, end); } else { return strLengthWithCodeRangeNonAsciiCompatible(enc, bytes, p, end); } }
public static long strLengthWithCodeRange(Encoding enc, byte[]bytes, int p, int end) { if (enc.isFixedWidth()) { return (end - p + enc.minLength() - 1) / enc.minLength(); } else if (enc.isAsciiCompatible()) { return strLengthWithCodeRangeAsciiCompatible(enc, bytes, p, end); } else { return strLengthWithCodeRangeNonAsciiCompatible(enc, bytes, p, end); } }
public static long strLengthWithCodeRange(Encoding enc, byte[]bytes, int p, int end) { if (enc.isFixedWidth()) { return (end - p + enc.minLength() - 1) / enc.minLength(); } else if (enc.isAsciiCompatible()) { return strLengthWithCodeRangeAsciiCompatible(enc, bytes, p, end); } else { return strLengthWithCodeRangeNonAsciiCompatible(enc, bytes, p, end); } }
public boolean isCodeInCC(Encoding enc, int code) { int len; if (enc.minLength() > 1) { len = 2; } else { len = enc.codeToMbcLength(code); } return isCodeInCCLength(len, code); }
public static long strLengthWithCodeRange(Encoding enc, byte[]bytes, int p, int end) { if (enc.isFixedWidth()) { return (end - p + enc.minLength() - 1) / enc.minLength(); } else if (enc.isAsciiCompatible()) { return strLengthWithCodeRangeAsciiCompatible(enc, bytes, p, end); } else { return strLengthWithCodeRangeNonAsciiCompatible(enc, bytes, p, end); } }
public boolean isCodeInCC(Encoding enc, int code) { int len; if (enc.minLength() > 1) { len = 2; } else { len = enc.codeToMbcLength(code); } return isCodeInCCLength(len, code); }
private int compileLengthCClassNode(CClassNode cc) { int len; if (cc.mbuf == null) { len = OPSize.OPCODE + BitSet.BITSET_SIZE; } else { if (enc.minLength() > 1 || cc.bs.isEmpty()) { len = OPSize.OPCODE; } else { len = OPSize.OPCODE + BitSet.BITSET_SIZE; } len += OPSize.LENGTH + cc.mbuf.getUsed(); } return len; }
public static int scanForCodeRange(ByteList byteList) { Encoding enc = byteList.getEncoding(); if (enc.minLength() > 1 && enc.isDummy()) { return CR_BROKEN; } else { return codeRangeScan(EncodingUtils.getActualEncoding(enc, byteList), byteList); } }
public static int scanForCodeRange(ByteList byteList) { Encoding enc = byteList.getEncoding(); if (enc.minLength() > 1 && enc.isDummy()) { return CR_BROKEN; } else { return codeRangeScan(EncodingUtils.getActualEncoding(enc, byteList), byteList); } }
public static int length(Encoding enc, byte[]bytes, int p, int end) { int n = enc.length(bytes, p, end); if (MBCLEN_CHARFOUND_P(n) && MBCLEN_CHARFOUND_LEN(n) <= end - p) return MBCLEN_CHARFOUND_LEN(n); int min = enc.minLength(); return min <= end - p ? min : end - p; }
public static int length(Encoding enc, byte[]bytes, int p, int end) { int n = enc.length(bytes, p, end); if (MBCLEN_CHARFOUND_P(n) && MBCLEN_CHARFOUND_LEN(n) <= end - p) return MBCLEN_CHARFOUND_LEN(n); int min = enc.minLength(); return min <= end - p ? min : end - p; }