Create a Java Vector from arguments


/**
 * Returns a java.util.Vector containing all arguments as elements.
 * Example:
 * - return a vector of three elements:
 * asVector("one", "two", "three")
 * - return a document from a view. The key is constructed from two values from url params.
 * view.getDocumentByKey(asVector(param.one, param.two), true)
 */
function asVector(/* arguments */): java.util.Vector {
    var v = new java.util.Vector();
    for (var i=0; i<arguments.length; i++) {
        v.push(arguments[i]);
    }
    return v;
}
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...