Klasse BNDMWildcards


public class BNDMWildcards extends BNDM
An implementation of the BNDM algorithm with wildcards ("don't care" symbols). The wildcard character is initially '?', but any character can be used through the processChars(char[], char) and the (byte[], byte) methods.

This algorithm is around five times faster than com.eaio.stringsearch.ShiftOrWildcards.

 Preprocessing: O(2m + ∑) time
 
Version:
1.2
Autor:
Johann Burkard
Siehe auch:
  • Felddetails

    • wildcard

      public static char wildcard
      The wildcard character (initially '?').
  • Konstruktordetails

    • BNDMWildcards

      public BNDMWildcards()
      Constructor for BNDMWildcards. Note that it is not required to create multiple instances.
  • Methodendetails

    • processBytes

      public Object processBytes(byte[] pattern)
      Pre-processing of the pattern. The pattern may not exceed 32 bytes in length. If it does, only it's first 32 bytes are processed which might lead to unexpected results. The wildcard character is obtained from the static wildcard field. com.eaio.stringsearch.StringSearch#processBytes(byte[])
      Setzt außer Kraft:
      processBytes in Klasse BNDM
      Parameter:
      pattern - the byte array containing the pattern, may not be null
      Gibt zurück:
      an Object
      Siehe auch:
    • processBytes

      public Object processBytes(byte[] pattern, byte w)
      Pre-processing of the pattern. The pattern may not exceed 32 bytes in length. If it does, only it's first 32 bytes are processed which might lead to unexpected results. Returns an int array.
      Parameter:
      pattern - the byte array containing the pattern, may not be null
      w - the wildcard byte character
      Gibt zurück:
      an int array
    • processChars

      public Object processChars(char[] pattern)
      Pre-processes the pattern. The pattern may not exceed 32 characters in length. If it does, only it's first 32 bytes are processed which might lead to unexpected results. The wildcard character is obtained from the static wildcard field.
      Setzt außer Kraft:
      processChars in Klasse BNDM
      Parameter:
      pattern - the char array containing the pattern, may not be null
      Gibt zurück:
      a CharIntMap
      Siehe auch:
    • processChars

      public Object processChars(char[] pattern, char w)
      Pre-processes the pattern. The pattern may not exceed 32 characters in length. If it does, only it's first 32 bytes are processed which might lead to unexpected results. Returns a CharIntMap.
      Parameter:
      pattern - the char array containing the pattern, may not be null
      w - the wildcard character
      Gibt zurück:
      a CharIntMap.
    • processString

      public Object processString(String pattern, char w)
      Pre-processes the pattern. The pattern may not exceed 32 characters in length. If it does, only it's first 32 bytes are processed which might lead to unexpected results. Returns a CharIntMap.
      Parameter:
      pattern - the String array containing the pattern, may not be null
      w - the wildcard character
      Gibt zurück:
      a CharIntMap.