org.alfresco.repo.search.impl.lucene.query
Class AbstractStructuredFieldPosition

java.lang.Object
  extended by org.alfresco.repo.search.impl.lucene.query.AbstractStructuredFieldPosition
All Implemented Interfaces:
StructuredFieldPosition
Direct Known Subclasses:
AbsoluteStructuredFieldPosition, AnyStructuredFieldPosition, RelativeStructuredFieldPosition, SelfAxisStructuredFieldPosition

public abstract class AbstractStructuredFieldPosition
extends java.lang.Object
implements StructuredFieldPosition


Constructor Summary
AbstractStructuredFieldPosition(java.lang.String termText, boolean isTerminal, boolean isAbsolute)
           
 
Method Summary
 boolean allowslinkingByParent()
           
 boolean allowsLinkingBySelf()
           
 boolean equals(java.lang.Object obj)
           
 CachingTermPositions getCachingTermPositions()
           
abstract  java.lang.String getDescription()
           
 int getPosition()
          If absolute return the position.
 java.lang.String getTermText()
          Get the test to search for in the term query.
 int hashCode()
           
 boolean isAbsolute()
          Is this an absolute element; that is, it knows its exact position.
 boolean isDescendant()
           
 boolean isRelative()
          This element only knows its position relative to the previous element.
 boolean isTerminal()
          If this position is last in the chain and it is terminal it will ensure it is an exact match for the length of the chain found.
 boolean linkParent()
           
 boolean linkSelf()
          Normally paths would require onlt parent chaining.
 boolean matchesAll()
           
 void setCachingTermPositions(CachingTermPositions tps)
          A reference to the caching term positions this element uses.
protected  void setTerminal(boolean isTerminal)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.search.impl.lucene.query.StructuredFieldPosition
matches
 

Constructor Detail

AbstractStructuredFieldPosition

public AbstractStructuredFieldPosition(java.lang.String termText,
                                       boolean isTerminal,
                                       boolean isAbsolute)
Method Detail

isTerminal

public boolean isTerminal()
Description copied from interface: StructuredFieldPosition
If this position is last in the chain and it is terminal it will ensure it is an exact match for the length of the chain found. If false, it will effectively allow prefix mathces for the likes of descendant-and-below style queries.

Specified by:
isTerminal in interface StructuredFieldPosition
Returns:

setTerminal

protected void setTerminal(boolean isTerminal)

isAbsolute

public boolean isAbsolute()
Description copied from interface: StructuredFieldPosition
Is this an absolute element; that is, it knows its exact position.

Specified by:
isAbsolute in interface StructuredFieldPosition
Returns:

isRelative

public boolean isRelative()
Description copied from interface: StructuredFieldPosition
This element only knows its position relative to the previous element.

Specified by:
isRelative in interface StructuredFieldPosition
Returns:

getTermText

public java.lang.String getTermText()
Description copied from interface: StructuredFieldPosition
Get the test to search for in the term query. This may be null if it should not have a term query

Specified by:
getTermText in interface StructuredFieldPosition
Returns:

getPosition

public int getPosition()
Description copied from interface: StructuredFieldPosition
If absolute return the position. If relative we could compute the position knowing the previous term unless this element is preceded by a descendat and below style element

Specified by:
getPosition in interface StructuredFieldPosition
Returns:

setCachingTermPositions

public void setCachingTermPositions(CachingTermPositions tps)
Description copied from interface: StructuredFieldPosition
A reference to the caching term positions this element uses. This may be null which indicates all terms match, in that case there is no action against the index

Specified by:
setCachingTermPositions in interface StructuredFieldPosition

getCachingTermPositions

public CachingTermPositions getCachingTermPositions()
Specified by:
getCachingTermPositions in interface StructuredFieldPosition

allowsLinkingBySelf

public boolean allowsLinkingBySelf()
Specified by:
allowsLinkingBySelf in interface StructuredFieldPosition

allowslinkingByParent

public boolean allowslinkingByParent()
Specified by:
allowslinkingByParent in interface StructuredFieldPosition

linkParent

public boolean linkParent()
Specified by:
linkParent in interface StructuredFieldPosition

linkSelf

public boolean linkSelf()
Description copied from interface: StructuredFieldPosition
Normally paths would require onlt parent chaining. for some it is parent and child chaining.

Specified by:
linkSelf in interface StructuredFieldPosition
Returns:

toString

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

getDescription

public abstract java.lang.String getDescription()

isDescendant

public boolean isDescendant()
Specified by:
isDescendant in interface StructuredFieldPosition

matchesAll

public boolean matchesAll()
Specified by:
matchesAll in interface StructuredFieldPosition

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.