opendap/src/main/java/opendap/dap/Util.java
static String[] sortedNames(Vector v) throws BadSemanticsException {
        String[] names = new String[v.size()];
        int count = 0;
        for (Enumeration e = v.elements(); e.hasMoreElements();) {
            BaseType bt = (BaseType) e.nextElement();
            String tempName = bt.getEncodedName();
            if (tempName == null)
                throw new BadSemanticsException(bt.getClass().getName() + " variable with no name");
            names[count++] = tempName;
        }
        // DEBUG: print out names
        //for(int i=0; i<names.length; i++) {
        //  LogStream.err.println("names[" + i + "] = " + names[i]);
        //}
        // assert that size is correct
        if (count != names.length)
            throw new IndexOutOfBoundsException("Vector size changed unexpectedly");
        quickSort(names, 0, names.length - 1);
        return names;
    }
static String[] sortedNames(Vector v) throws BadSemanticsException {
        String[] names = new String[v.size()];
        int count = 0;
        for (Enumeration e = v.elements(); e.hasMoreElements();) {
            BaseType bt = (BaseType) e.nextElement();
            String tempName = bt.getEncodedName();
            if (tempName == null)
                throw new BadSemanticsException(bt.getClass().getName() + " variable with no name");
            names[count++] = tempName;
        }
        // DEBUG: print out names
        //for(int i=0; i<names.length; i++) {
        //  LogStream.err.println("names[" + i + "] = " + names[i]);
        //}
        // assert that size is correct
        if (count != names.length)
            throw new IndexOutOfBoundsException("Vector size changed unexpectedly");
        quickSort(names, 0, names.length - 1);
        return names;
    }
Takes a <code>Vector</code> of <code>BaseType</code>s, retrieves their
names into an array of <code>String</code>s, and performs a Quick Sort
on that array.

@param v The Vector to check
@return a sorted array of <code>String</code>
@throws BadSemanticsException if there is an element with no name