Lines Matching refs:group

280      * Compute the binary size of the character array in a group
285 * @param group the group
288 private static int getGroupCharactersSize(final CharGroup group) {
289 int size = CharEncoding.getCharArraySize(group.mChars);
290 if (group.hasSeveralChars()) size += FormatSpec.GROUP_TERMINATOR_SIZE;
295 * Compute the binary size of the group count
296 * @param count the group count
297 * @return the size of the group count, either 1 or 2 bytes.
312 * Compute the binary size of the group count for a node
314 * @return the size of the group count, either 1 or 2 bytes.
353 * @param group the CharGroup to compute the size of.
355 * @return the maximum size of the group.
357 private static int getCharGroupMaximumSize(final CharGroup group, final FormatOptions options) {
358 int size = getGroupHeaderSize(group, options);
360 if (group.isTerminal()) size += FormatSpec.GROUP_FREQUENCY_SIZE;
362 size += getShortcutListSize(group.mShortcutTargets);
363 if (null != group.mBigrams) {
366 * group.mBigrams.size();
399 * Helper method to check whether the group is moved.
416 * @param group the group of which to compute the size of the header
419 private static int getGroupHeaderSize(final CharGroup group, final FormatOptions options) {
422 + getGroupCharactersSize(group);
424 return FormatSpec.GROUP_FLAGS_SIZE + getGroupCharactersSize(group);
494 for (CharGroup group : branches) {
495 if (null != group.mChildren) flattenTreeInner(list, group.mChildren);
530 for (CharGroup group : node.mData) {
531 if (group.mCachedAddress != node.mCachedAddress + size) {
533 group.mCachedAddress = node.mCachedAddress + size;
535 int groupSize = getGroupHeaderSize(group, formatOptions);
536 if (group.isTerminal()) groupSize += FormatSpec.GROUP_FREQUENCY_SIZE;
537 if (null == group.mChildren && formatOptions.mSupportsDynamicUpdate) {
539 } else if (null != group.mChildren) {
541 final int offset = group.mChildren.mCachedAddress - offsetBasePoint;
543 group.mChildren.mCachedParentAddress = group.mCachedAddress
544 - group.mChildren.mCachedAddress;
551 groupSize += getShortcutListSize(group.mShortcutTargets);
552 if (null != group.mBigrams) {
553 for (WeightedString bigram : group.mBigrams) {
561 group.mCachedSize = groupSize;
724 private static byte makeCharGroupFlags(final CharGroup group, final int groupAddress,
727 if (group.mChars.length > 1) flags |= FormatSpec.FLAG_HAS_MULTIPLE_CHARS;
728 if (group.mFrequency >= 0) {
731 if (null != group.mChildren) {
750 if (null != group.mShortcutTargets) {
751 if (DBG && 0 == group.mShortcutTargets.size()) {
756 if (null != group.mBigrams) {
757 if (DBG && 0 == group.mBigrams.size()) {
762 if (group.mIsNotAWord) {
765 if (group.mIsBlacklistEntry) {
917 CharGroup group = node.mData.get(i);
918 if (index != group.mCachedAddress) throw new RuntimeException("Bug: write index is not "
919 + "the same as the cached address of the group : "
920 + index + " <> " + group.mCachedAddress);
921 groupAddress += getGroupHeaderSize(group, formatOptions);
923 if (DBG && group.mFrequency > FormatSpec.MAX_TERMINAL_FREQUENCY) {
926 + " : " + group.mFrequency);
928 if (group.mFrequency >= 0) groupAddress += FormatSpec.GROUP_FREQUENCY_SIZE;
929 final int childrenOffset = null == group.mChildren
931 : group.mChildren.mCachedAddress - groupAddress;
932 byte flags = makeCharGroupFlags(group, groupAddress, childrenOffset, formatOptions);
939 parentAddress + (node.mCachedAddress - group.mCachedAddress),
943 index = CharEncoding.writeCharArray(group.mChars, buffer, index);
944 if (group.hasSeveralChars()) {
947 if (group.mFrequency >= 0) {
948 buffer[index++] = (byte) group.mFrequency;
961 if (null != group.mShortcutTargets) {
965 final Iterator<WeightedString> shortcutIterator = group.mShortcutTargets.iterator();
984 if (null != group.mBigrams) {
985 final Iterator<WeightedString> bigramIterator = group.mBigrams.iterator();
1327 * Reads and returns the char group count out of a buffer and forwards the pointer.