Methods Summary |
---|
protected java.lang.String | getBracketClose() return ")";
|
protected java.lang.String | getBracketOpen() return "(";
|
public int | getNrSubQueries()return queries.size();
|
public java.lang.String | getOperatorName()return opName;
|
protected java.lang.String | getPrefixSeparator() return ", ";
|
public java.util.Iterator | getSubQueriesIterator()return queries.listIterator();
|
public SrndQuery | getSubQuery(int qn)return (SrndQuery) queries.get(qn);
|
protected void | infixToString(java.lang.StringBuffer r)
/* Brackets are possibly redundant in the result. */
Iterator sqi = getSubQueriesIterator();
r.append(getBracketOpen());
if (sqi.hasNext()) {
r.append(sqi.next().toString());
while (sqi.hasNext()) {
r.append(" ");
r.append(getOperatorName()); /* infix operator */
r.append(" ");
r.append(sqi.next().toString());
}
}
r.append(getBracketClose());
|
public boolean | isFieldsSubQueryAcceptable()
/* at least one subquery should be acceptable */
Iterator sqi = getSubQueriesIterator();
while (sqi.hasNext()) {
if (((SrndQuery) sqi.next()).isFieldsSubQueryAcceptable()) {
return true;
}
}
return false;
|
public boolean | isOperatorInfix() return operatorInfix;
|
public java.util.List | makeLuceneSubQueriesField(java.lang.String fn, BasicQueryFactory qf)
ArrayList luceneSubQueries = new ArrayList();
Iterator sqi = getSubQueriesIterator();
while (sqi.hasNext()) {
luceneSubQueries.add( ((SrndQuery) sqi.next()).makeLuceneQueryField(fn, qf));
}
return luceneSubQueries;
|
protected void | prefixToString(java.lang.StringBuffer r)
Iterator sqi = getSubQueriesIterator();
r.append(getOperatorName()); /* prefix operator */
r.append(getBracketOpen());
if (sqi.hasNext()) {
r.append(sqi.next().toString());
while (sqi.hasNext()) {
r.append(getPrefixSeparator());
r.append(sqi.next().toString());
}
}
r.append(getBracketClose());
|
protected void | recompose(java.util.List queries)
if (queries.size() < 2) throw new AssertionError("Too few subqueries");
this.queries = queries;
|
public java.lang.String | toString()
StringBuffer r = new StringBuffer();
if (isOperatorInfix()) {
infixToString(r);
} else {
prefixToString(r);
}
weightToString(r);
return r.toString();
|