projects
/
cql-java-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite XML serialization avoiding string concats
[cql-java-moved-to-github.git]
/
src
/
main
/
java
/
org
/
z3950
/
zing
/
cql
/
CQLSortNode.java
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
(file)
--- 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;
// $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.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.
*/
* each expressed as an index together with zero or more
* modifiers.
*/
- Vector<ModifierSet> keys;
+ List<ModifierSet> keys;
public CQLNode getSubtree() {
return subtree;
public CQLNode getSubtree() {
return subtree;
@@
-30,42
+31,46
@@
public class CQLSortNode extends CQLNode {
public CQLSortNode(CQLNode subtree) {
this.subtree = subtree;
public CQLSortNode(CQLNode subtree) {
this.subtree = subtree;
- keys = new Vector<ModifierSet>();
+ keys = new ArrayList<ModifierSet>();
}
public void addSortIndex(ModifierSet key) {
keys.add(key);
}
}
public void addSortIndex(ModifierSet key) {
keys.add(key);
}
- public Vector<ModifierSet> getSortIndexes() {
+ public List<ModifierSet> getSortIndexes() {
return keys;
}
return keys;
}
- public String toXCQL(int level, Vector<CQLPrefix> prefixes,
- Vector<ModifierSet> sortkeys) {
+ @Override
+ void toXCQLInternal(XCQLBuilder b, int level, List<CQLPrefix> prefixes,
+ List<ModifierSet> sortkeys) {
if (sortkeys != null)
throw new Error("CQLSortNode.toXCQL() called with 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() {
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);
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();
}
}
}
return buf.toString();
}
+ @Override
public String toPQF(Properties config) throws PQFTranslationException {
return "@attr 1=oops \"###\"";
}
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
public byte[] toType1BER(Properties config)
throws PQFTranslationException {
// There is no way to represent sorting in a standard Z39.50