Project

General

Profile

« Previous | Next » 

Revision 2419

Added by sgarg over 19 years ago

Added a function which gives back a string which is generated by sorting the returnfields requested for given query specifications

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
46 46
import org.xml.sax.XMLReader;
47 47
import org.xml.sax.helpers.DefaultHandler;
48 48
import org.xml.sax.helpers.XMLReaderFactory;
49
import java.util.Iterator;
49 50

  
50 51
/**
51 52
 * A Class that represents a structured query, and can be constructed from an
......
935 936
        return self.toString();
936 937
    }
937 938

  
939

  
938 940
    /**
941
     * Method to return a String generated after sorting the returnFieldList
942
     * Vector
943
     */
944
    public String getSortedReturnFieldString(){
945
        String returnFields = "";
946

  
947
        // Create a temporary vector and copy returnFieldList into it
948
        Vector tempVector = new Vector();
949
        Iterator it = returnFieldList.iterator();
950
        while(it.hasNext()){
951
            tempVector.add(it.next());
952
        }
953

  
954
        // Sort the temporary vector
955
        java.util.Collections.sort(tempVector);
956

  
957
        // Generate the string and return it
958
        it = tempVector.iterator();
959
        while(it.hasNext()){
960
            returnFields = returnFields + it.next() + "|";
961
        }
962
        return returnFields;
963
    }
964

  
965

  
966
    /**
939 967
     * Create the SQl necessary to restrict access to allowed nodes.  This is
940 968
     * accomplished by restricting the nodes that are returned to include
941 969
     * only those whose IDs fall outside of a set of start/stop pairs of

Also available in: Unified diff