Class PhraseMatcher.Phrase

  • Enclosing class:
    PhraseMatcher

    public static class PhraseMatcher.Phrase
    extends java.lang.Object
    Points to a collection of word items (one or more) which is matches a complete listing in an automat
    • Constructor Summary

      Constructors 
      Constructor Description
      Phrase​(TermItem item, java.lang.String replace, java.lang.String data)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBackedLength()
      Returns the length of the underlying phrase
      java.lang.String getData()
      Returns the data stored by the automaton for this phrase at this position, or null if none
      TermItem getItem​(int index)
      Returns the n'th item in this, throws if index out of bounds
      int getLength()  
      CompositeItem getOwner()
      Returns the owner, or null if this is a single item phrase with no owner
      int getStartIndex()  
      boolean isComplete()
      Returns true if this phrase contains all the words of the owner, or if there is no owner
      PhraseMatcher.Phrase.MatchIterator itemIterator()
      Returns the items of this phrase as a read-only iterator
      void remove()
      Removes the word items of this phrase.
      void replace()
      Replaces the words items of this phrase with a phrase item.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Phrase

        public Phrase​(TermItem item,
                      java.lang.String replace,
                      java.lang.String data)
    • Method Detail

      • getOwner

        public CompositeItem getOwner()
        Returns the owner, or null if this is a single item phrase with no owner
      • getStartIndex

        public int getStartIndex()
      • getLength

        public int getLength()
      • getData

        public java.lang.String getData()
        Returns the data stored by the automaton for this phrase at this position, or null if none
      • getItem

        public TermItem getItem​(int index)
        Returns the n'th item in this, throws if index out of bounds
      • isComplete

        public boolean isComplete()
        Returns true if this phrase contains all the words of the owner, or if there is no owner
      • replace

        public void replace()
        Replaces the words items of this phrase with a phrase item. Does nothing if this is not a composite match
      • remove

        public void remove()
        Removes the word items of this phrase. Does nothing nuless this is a composite
      • getBackedLength

        public int getBackedLength()
        Returns the length of the underlying phrase
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object