Class WordItem

    • Constructor Detail

      • WordItem

        public WordItem​(java.lang.String word)
      • WordItem

        public WordItem​(java.lang.String word,
                        java.lang.String indexName)
      • WordItem

        public WordItem​(java.lang.String word,
                        boolean isFromQuery)
      • WordItem

        public WordItem​(java.lang.String word,
                        java.lang.String indexName,
                        boolean isFromQuery)
      • WordItem

        public WordItem​(Token word,
                        boolean isFromQuery)
      • WordItem

        public WordItem​(java.lang.String word,
                        boolean isFromQuery,
                        Substring origin)
      • WordItem

        public WordItem​(java.lang.String word,
                        java.lang.String indexName,
                        boolean isFromQuery,
                        Substring origin)
    • Method Detail

      • getItemType

        public Item.ItemType getItemType()
        Description copied from class: Item
        Return the enumerated type of this item.
        Specified by:
        getItemType in class Item
      • getName

        public java.lang.String getName()
        Description copied from class: Item
        Returns the name of this item
        Specified by:
        getName in class Item
      • setWord

        public void setWord​(java.lang.String word)
      • getEncodedWord

        protected java.lang.String getEncodedWord()
        Returns the word for encoding. By default simply the word
      • getWord

        public java.lang.String getWord()
        Returns the same as stringValue()
      • stringValue

        public java.lang.String stringValue()
        Returns this word as it should be used in executing the query. This is usually (but not always) a normalized and stemmed form
      • setValue

        public void setValue​(java.lang.String value)
        Same as #setWord
        Specified by:
        setValue in class TermItem
      • getRawWord

        public java.lang.String getRawWord()
        Get the word exactly as received in the request. This returns the same as getWord if no other raw form is known
        Specified by:
        getRawWord in interface BlockItem
        Specified by:
        getRawWord in class TermItem
        Returns:
        the raw form of this word, never null
      • isStemmed

        public boolean isStemmed()
      • setStemmed

        public void setStemmed​(boolean stemmed)
      • isFromSegmented

        public boolean isFromSegmented()
      • setFromSegmented

        public void setFromSegmented​(boolean fromSegmented)
      • isLowercased

        public boolean isLowercased()
      • setLowercased

        public void setLowercased​(boolean lowercased)
      • getSegmentIndex

        public int getSegmentIndex()
      • setSegmentIndex

        public void setSegmentIndex​(int segmentIndex)
      • appendHeadingString

        protected void appendHeadingString​(java.lang.StringBuilder buffer)
        Word items uses a empty heading instead of "WORD "
        Overrides:
        appendHeadingString in class Item
      • equals

        public boolean equals​(java.lang.Object object)
        Description copied from class: Item
        Returns whether this item is of the same class and contains the same state as the given item
        Overrides:
        equals in class SimpleIndexedItem
      • getNumWords

        public int getNumWords()
        Returns:
        how many phrase words does this item contain
      • getIndexedString

        public java.lang.String getIndexedString()
        Description copied from interface: IndexedItem
        Return the searchable term contents of this item.
        Specified by:
        getIndexedString in interface IndexedItem
        Specified by:
        getIndexedString in class SimpleIndexedItem
        Returns:
        a string representation of what is presumably stored in an index which will match this item
      • isWords

        public boolean isWords()
        Returns true if this consists of regular word characters. Returns false if this represents a "special token"
        Specified by:
        isWords in interface BlockItem
        Specified by:
        isWords in class TermItem
      • setWords

        public void setWords​(boolean words)
        Sets if this consists of regular word characters (true) or represents a "special token" (false)