X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLSortNode.java;h=68a4ea905203bf2707018f3ef9c67cd0bb675047;hb=64ca1306b4e0d55a8b15b8da982bc1d37bc8b63c;hp=53c7ef1543cafca06b99b11e8af3dacb1c57c9e7;hpb=41fcd9c3be17618728c4f175e4cb65ed61421447;p=cql-java-moved-to-github.git diff --git a/src/main/java/org/z3950/zing/cql/CQLSortNode.java b/src/main/java/org/z3950/zing/cql/CQLSortNode.java index 53c7ef1..68a4ea9 100644 --- a/src/main/java/org/z3950/zing/cql/CQLSortNode.java +++ b/src/main/java/org/z3950/zing/cql/CQLSortNode.java @@ -1,8 +1,9 @@ // $Id: CQLSortNode.java,v 1.2 2008-04-11 12:05:15 mike Exp $ package org.z3950.zing.cql; +import java.util.ArrayList; +import java.util.List; import java.util.Properties; -import java.util.Vector; /** @@ -22,7 +23,7 @@ public class CQLSortNode extends CQLNode { * each expressed as an index together with zero or more * modifiers. */ - Vector keys; + List keys; public CQLNode getSubtree() { return subtree; @@ -30,42 +31,46 @@ public class CQLSortNode extends CQLNode { public CQLSortNode(CQLNode subtree) { this.subtree = subtree; - keys = new Vector(); + keys = new ArrayList(); } public void addSortIndex(ModifierSet key) { keys.add(key); } - public Vector getSortIndexes() { + public List getSortIndexes() { return keys; } - public String toXCQL(int level, Vector prefixes, - Vector sortkeys) { + @Override + void toXCQLInternal(XCQLBuilder b, int level, List prefixes, + List sortkeys) { if (sortkeys != null) throw new Error("CQLSortNode.toXCQL() called with sortkeys"); - return subtree.toXCQL(level, prefixes, keys); + subtree.toXCQLInternal(b, level, prefixes, keys); } + @Override public String toCQL() { - StringBuffer buf = new StringBuffer(subtree.toCQL()); + StringBuilder buf = new StringBuilder(subtree.toCQL()); if (keys != null) { buf.append(" sortby"); for (int i = 0; i < keys.size(); i++) { ModifierSet key = keys.get(i); - buf.append(" " + key.toCQL()); + buf.append(" ").append(key.toCQL()); } } return buf.toString(); } + @Override public String toPQF(Properties config) throws PQFTranslationException { return "@attr 1=oops \"###\""; } + @Override public byte[] toType1BER(Properties config) throws PQFTranslationException { // There is no way to represent sorting in a standard Z39.50