Example usage for java.util Vector Vector

List of usage examples for java.util Vector Vector

Introduction

In this page you can find the example usage for java.util Vector Vector.

Prototype

public Vector() 

Source Link

Document

Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.

Usage

From source file:com.nec.nsgui.taglib.nssorttab.ListSTModel.java

public void sort(String colName, boolean isAscend, String sideSortOrder, Hashtable comparators) {

    if (colName == null || colName.trim().equals("")) {
        return;/* www.  j  a  v a 2  s . c o  m*/
    }

    if (comparators == null) {
        return;
    }

    if (dataList.size() <= 1) {
        return;
    }
    Vector sortData = new Vector();

    sortData.add(colName);
    sortData.add((comparators.get(colName)));

    if (sideSortOrder != null) {
        String[] orders = sideSortOrder.split(" ");

        for (int i = 0; i < orders.length; i++) {
            String order = orders[i];
            if (!(order.trim().equals(""))) {
                sortData.add(order);
                sortData.add((comparators.get(order)));
            }
        }
    }

    SortComparator comp = new SortComparator(isAscend, sortData);
    Collections.sort(dataList, comp);

    return;
}

From source file:Main.java

public MyTextHandler() {
    personVec = new Vector<Person>();
}

From source file:com.best.otp.CLeg.java

void getLeg() {
    try {/*w w  w .j a v  a  2  s  . c  o m*/
        if (m_legJsonObject != null) {
            v2 = new Vector();
            legStartTimeOb = m_legJsonObject.get("startTime");//n //legStartTimeObject
            if (legStartTimeOb != null) {
                System.out.println("legStartTimeOb in CLEG " + legStartTimeOb.toString());
                formatMilsec = new FormatMilsec(legStartTimeOb.toString());
                legStartTimeObject = formatMilsec.getDate();
                System.out.println("legStartTimeObject " + legStartTimeObject);
            }
            legEndTimeOb = m_legJsonObject.get("endTime");//n
            if (legEndTimeOb != null) {
                formatMilsec = new FormatMilsec(legEndTimeOb.toString()); //legEndTime
                legEndTime = formatMilsec.getDate();
                System.out.println("legEndTime " + legEndTime);
            }
            legAgencyName = m_legJsonObject.get("agencyName");
            legAgencyUrl = m_legJsonObject.get("agencyUrl");
            legRouteColor = m_legJsonObject.get("routeColor");
            legRouteTextColor = m_legJsonObject.get("routeTextColor");
            legInterlineWithPreviousLeg = m_legJsonObject.get("interlineWithPreviousLeg");
            legTripShortName = m_legJsonObject.get("tripShortName");
            legHeadsign = m_legJsonObject.get("headsign");
            legRouteShortName = m_legJsonObject.get("routeShortName");
            legBoardRule = m_legJsonObject.get("boardRule");
            legAlightRule = m_legJsonObject.get("alightRule");
            legDistance = m_legJsonObject.get("distance");
            if (m_legJsonObject.get("mode") != null)
                legMode = m_legJsonObject.get("mode").toString();

            if (m_legJsonObject.get("route") != null)
                legRoute = m_legJsonObject.get("route").toString();
            legAgencyId = m_legJsonObject.get("agencyId");
            //if(m_legJsonObject.get("tripId")!=null)
            legTripId = m_legJsonObject.get("tripId");
            //else
            //legTripId="";
            if (m_legJsonObject.get("routeLongName") != null)
                legRouteLongName = m_legJsonObject.get("routeLongName").toString();
            else
                legRouteLongName = "";
            legDuration = ((m_legJsonObject.get("duration")));
            legBogusNonTransitLeg = m_legJsonObject.get("bogusNonTransitLeg");
            legIntermediateStopsObject = m_legJsonObject.get("intermediateStops");

            legFrom = new CLegFrom(m_legJsonObject);
            From_name = legFrom.getLegFrom();

            legTo = new CLegTo(m_legJsonObject);
            To_name = legTo.getLegTo();

            leglegGeometry = new CLeglegGeometry(m_legJsonObject);
            leglegGeometry.getLegGeometry();

            legStep = new CLegStep(m_legJsonObject);
            legStep.getLegStep();

            list.add(legStep);
            modeRoute = legMode + " " + legRoute;

            // v2.add(modeRoute) ;//0
            // v2.add(From_name);    //1
            // v2.add(To_name);       //2
            // v2.add(legStartTimeObject);//3
            //v2.add(legEndTime);        //4
        }
    }

    catch (Exception e) {
        System.out.println(e);
    }
}

From source file:com.alfaariss.oa.engine.idp.storage.configuration.AbstractConfigurationStorage.java

/**
 * Constructor. /*from ww w  .jav  a2s  .  c om*/
 */
public AbstractConfigurationStorage() {
    _htIDPs = new Hashtable<String, IDP>();
    _listIDPs = new Vector<IIDP>();
}

From source file:Main.java

/**
 * Reads the next xml attribute in a tag.
 * @return  A vector with two elements.  The first element is
 *          the xml attributes key and the second its value as a String
 *//*from w  w w . j av a 2s  .  c o  m*/
public static Vector getNextAttribute(InputStream is) {
    errormessage = null;
    Vector Res = new Vector();
    try {
        char c;
        sb.setLength(0);
        if (lastchar == '>')
            return Res;
        else
            c = findChar(is, delimiters, false);

        if (c == '>') {
            lastchar = '>';
            return Res;
        }
        sb.setLength(0);
        sb.append(c);

        getNextWord(is);
        String U = sb.toString();
        sb.setLength(0);

        Res.addElement(U);
        if (lastchar == '=')
            c = lastchar;
        else {
            c = findChar(is, " \n\r\f\t", false);
        }
        if (c != '=') {
            errormessage = "Improperly formed attribute. Need =" + U + "::" + c;
            return null;
        }
        c = findChar(is, " \t\r\n\f", false);

        if (c != '\"') {
            errormessage = "Attribute values must be quoted " + c + U;
            return null;
        }
        sb.setLength(0);
        for (c = (char) is.read(); c != '\"'; c = (char) is.read())
            sb.append(c);
        lastchar = 0;

        Res.addElement(sb.toString());
        //lastchar = c;
        return Res;

    } catch (Exception s) {
        errormessage = s.getMessage();
        return null;
    }

}

From source file:MainClass.java

public QueryTableModel() {
    cache = new Vector();
}

From source file:edu.uga.cs.fluxbuster.clustering.hierarchicalclustering.DistanceMatrix.java

/**
 * Loads the distance matrix from a file which contains the upper triangle
 * values in a single row./*from   w ww .  jav a 2s  .  co m*/
 * 
 * @param path
 *            the path to the matrix file
 * @throws IOException
 *             if the matrix values file can not be read
 */
public DistanceMatrix(String path) throws IOException {
    distMatrix = new Vector<Vector<Float>>();
    BufferedReader br = new BufferedReader(new FileReader(path));
    String[] strvals = br.readLine().split("\\s");
    Vector<Float> vals = new Vector<Float>();
    for (String s : strvals) {
        vals.add(Float.valueOf(s));
    }
    br.close();
    populateDistanceMatrix(vals);
}

From source file:com.sbu.controller.Feed_Form_Employer_Edit_Contorller.java

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    List<Project> projects;
    List<Skills> skills;/*ww w  . j a  va 2s. c o m*/
    Vector<Project> filtered_projects = new Vector<>();
    Vector<Skills> filtered_skills = new Vector<>();
    List<Employer> users;
    Employer user = null;
    request.setCharacterEncoding("UTF-8");
    HttpSession session = request.getSession();

    int id = Integer.parseInt(request.getParameter("id"));

    //user = employerService.getEmployer(id);

    skills = skillsService.getAllSkills();
    projects = projectService.getAllProjects();
    users = employerService.getAllEmployers();
    for (int i = 0; i < users.size(); i++) {
        if (users.get(i).getIdEmployer() == id) {
            user = users.get(i);
            break;
        }
    }

    for (int i = 0; i < skills.size(); i++) {
        if (skills.get(i).getEmployeridEmployer().equals(user))
            filtered_skills.add(skills.get(i));
    }

    for (int i = 0; i < projects.size(); i++) {
        if (projects.get(i).getEmployeridEmployer().equals(user))
            filtered_projects.add(projects.get(i));
    }

    request.setAttribute("User", user);
    request.setAttribute("projects", filtered_projects);
    request.setAttribute("skills", filtered_skills);

    getServletContext().getRequestDispatcher("/accountsetting_Employer_Edit.jsp").forward(request, response);

}

From source file:cat.albirar.framework.sets.impl.SetBuilderDefaultImpl.java

/**
 * Unique constructor.//  www . java2s .  com
 * @param rootModel The root model to build the {@link ISet}. <b>required</b>
 * @throws IllegalArgumentException If the {@code rootModel} is null
 */
public SetBuilderDefaultImpl(Class<? extends T> rootModel) {
    Assert.notNull(rootModel, "The rootModel argument is required");
    this.rootModel = rootModel;
    pathStack = new Stack<ModelDescriptor>();
    properties = new Vector<String>();
    currentModelDescriptor = new ModelDescriptor(rootModel);
    // The root always on bottom of stack
    pathStack.push(currentModelDescriptor);
}