Exemplo n.º 1
0
 /**
  * Matches the fragment against the position in the ByteReader given.
  *
  * @param bytes The byte reader to match the bytes with.
  * @param matchFrom The position to match from.
  * @return Whether the fragment matches at the position given.
  */
 public final boolean matchesBytes(final ByteReader bytes, final long matchFrom) {
   return matcher.matches(bytes, matchFrom);
 }
Exemplo n.º 2
0
 /**
  * Returns a regular expression representation of this fragment.
  *
  * @param prettyPrint whether to pretty print the regular expression.
  * @return a regular expression defining this fragment, but minus any offsets defined here
  *     (handled by the parent subsequence).
  */
 public final String toRegularExpression(final boolean prettyPrint) {
   return matcher == null ? "" : matcher.toRegularExpression(prettyPrint);
 }
Exemplo n.º 3
0
 /** @return The number of bytes matched by this fragment. */
 public final int getNumBytes() {
   return matcher == null ? 0 : matcher.length();
 }