Creates an offset group using the same offset value as both the {@link
com.bbn.bue.common.strings.offsets.CharOffset} and {@link com.bbn.bue.common.strings.offsets.EDTOffset}.
This is for unit testing purposes and probably shouldn't be used in other code.
967957
public static OffsetGroup fromMatchingCharAndEDT(int offset) {
    return from(CharOffset.asCharOffset(offset), EDTOffset.asEDTOffset(offset));
  }
959882
public String group(String groupName) {
        int idx = groupIndex(groupName);
        if (idx < 0) {
          throw new IndexOutOfBoundsException("No group \"" + groupName + "\"");
        }
        return group(idx);
    }
747555
private void copyToOffset(int offset) {
    final int minCapacity = 2 * (offset + nbrruns);
    if (valueslength.length < minCapacity) {
      // expensive case where we need to reallocate
      int newCapacity = valueslength.length;
      while (newCapacity < minCapacity) {
        newCapacity = (newCapacity == 0) ? DEFAULT_INIT_SIZE
            : newCapacity < 64 ? newCapacity * 2
                : newCapacity < 1024 ? newCapacity * 3 / 2 : newCapacity * 5 / 4;
      }
      short[] newvalueslength = new short[newCapacity];
      copyValuesLength(this.valueslength, 0, newvalueslength, offset, nbrruns);
      this.valueslength = newvalueslength;
    } else {
      // efficient case where we just copy
      copyValuesLength(this.valueslength, 0, this.valueslength, offset, nbrruns);
    }
  }
1321786
public static char[] binToHex(byte[] bytes, int offset, int len) {
        final char[] sb = new char[len * 2];
        final int end = offset + len;
        int index = 0;
        final char[] hexs = hex;
        for (int i = offset; i < end; i++) {
            byte b = bytes[i];
            sb[index++] = (hexs[((b >> 4) & 0xF)]);
            sb[index++] = hexs[((b) & 0xF)];
        }
        return sb;
    }
892967
public PointF getTextOffset() {
    JsonArray jsonArray = jsonObject.getAsJsonArray(SymbolOptions.PROPERTY_TEXT_OFFSET);
    return new PointF(jsonArray.get(0).getAsFloat(), jsonArray.get(1).getAsFloat());
  }
1247305
public TableOperation createLimitWithOffset(int offset, TableOperation child) {
		SortTableOperation previousSort = validateAndGetChildSort(child);

		if (offset < 0) {
			throw new ValidationException("Offset should be greater or equal 0");
		}

		if (previousSort.getOffset() != -1) {
			throw new ValidationException("OFFSET already defined");
		}

		return new SortTableOperation(previousSort.getOrder(), previousSort.getChild(), offset, -1);
	}
1349072
public static CharacterSet createCharacterSet(final String encoding, final String goodExpression, final String badExpression,
			final String characterSetId) throws UnsupportedEncodingException {
		if (characterSets.get().containsKey(characterSetId)) {
			LOG.info("CharacterSet with id=" + characterSetId + " already created");
			return characterSets.get().get(characterSetId);
		}
		CharacterSet cs = new CharacterSet(encoding, goodExpression, badExpression, characterSetId);
		characterSets.get().put(characterSetId, cs);
		LOG.info("Added " + cs);
		return cs;
	}
18971
public OffsetRange<CharOffset> offsets() {
    final CharOffset start = tokens.get(0).offsets().startInclusive();
    final CharOffset end = tokens.reverse().get(0).offsets().endInclusive();
    return OffsetRange.charOffsetRange(start.asInt(), end.asInt());
  }
250913
public static String dump(final int displayOffset, final byte[] data, final int offset, final int len)
   {
      StringBuilder sb = new StringBuilder();
      Formatter formatter = new Formatter(sb);
      StringBuilder ascii = new StringBuilder();

      int dataNdx = offset;
      final int maxDataNdx = offset + len;
      final int lines = (len + 16) / 16;
      for (int i = 0; i < lines; i++) {
         ascii.append(" |");
         formatter.format("%08x  ", displayOffset + (i * 16));

         for (int j = 0; j < 16; j++) {
            if (dataNdx < maxDataNdx) {
               byte b = data[dataNdx++];
               formatter.format("%02x ", b);
               ascii.append((b > MIN_VISIBLE && b < MAX_VISIBLE) ? (char) b : ' ');
            }
            else {
               sb.append("   ");
            }

            if (j == 7) {
               sb.append(' ');
            }
         }

         ascii.append('|');
         sb.append(ascii).append('\n');
         ascii.setLength(0);
      }

      formatter.close();
      return sb.toString();
   }
880482
public static byte[] duplicateByteArray(byte[] in, int offset, int length)
    {
        if (in == null) return null;

        byte[] out =  new byte[length];
        System.arraycopy(in, offset, out, 0, length);

        return out;
    }
223714
public boolean precedesForAllOffsetTypesInBoth(final OffsetGroup other) {
    return charOffset().precedes(other.charOffset())
        && edtOffset().precedes(other.edtOffset())
        && (!byteOffset().isPresent() || !other.byteOffset().isPresent()
                || byteOffset().get().precedes(other.byteOffset().get()))
        && (!asrTime().isPresent() || !other.asrTime().isPresent()
                || asrTime().get().precedes(other.asrTime().get()));
  }
303464
public static char getChar(MemorySegment[] segments, int offset) {
		if (inFirstSegment(segments, offset, 2)) {
			return segments[0].getChar(offset);
		} else {
			return getCharMultiSegments(segments, offset);
		}
	}
1109665
public static int toChars(int i, char[] buf, int offset) {
        if (i < 0) {
            if (i == Integer.MIN_VALUE) {
                writeMinInteger(buf, offset);
                return offset + 11;
            }
            buf[offset++] = '-';
            i = -i;
        }

        offset += stringSizeOf(i);
        getChars(i, offset, buf);
        return offset;
    }
515554
public static <E, F> GroupExpression<E, Set<F>> set(GroupExpression<E, F> groupExpression) {
        return new MixinGroupExpression<E, F, Set<F>>(groupExpression, GSet.createLinked(groupExpression));
    }
23821
public OffsetGroup endReferenceOffsetsForContentOffset(CharOffset contentOffset) {
    return characterRegions().get(regionIndexContainingContentOffset(contentOffset))
        .endOffsetGroupForPosition(contentOffset);
  }
726252
public Optional<CoreNLPParseNode> nodeForOffsets(
      final OffsetRange<CharOffset> offsets) {
    // we use the reverse of the preorder traversal because it will iterate over smaller nodes
    // before any of their parents, preferring the smallest node that contains these offsets.
    for (final CoreNLPParseNode n : ImmutableList.copyOf(parse.get().root().preorderDFSTraversal())
        .reverse()) {
      if (n.span().isPresent() && n.span().get().contains(offsets)) {
        return Optional.of(n);
      }
    }
    return Optional.absent();
  }
840042
public final int offsetIn(String s) {
    for (int offset = 0; offset < s.length(); ) {
      final int codePoint = s.codePointAt(offset);
      if (matches(codePoint)) {
        return offset;
      }
      offset += Character.charCount(codePoint);
    }
    return NO_MATCH_OFFSET;
  }