Example usage for java.util Vector iterator

List of usage examples for java.util Vector iterator

Introduction

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

Prototype

public synchronized Iterator<E> iterator() 

Source Link

Document

Returns an iterator over the elements in this list in proper sequence.

Usage

From source file:pagecode.jsp.actions.scheduling.RequestForTrialAction.java

private static ArrayList processFirstAttendanceNotice(Vector requestForTrialToPrintVector,
        FirstAttendanceNoticeParameterFields firstAttendanceNoticeParameterFields, HttpServletRequest request) {
    logger.info("In RequestForTrialAction::processFirstAttendanceNotice");
    ArrayList notices = new ArrayList();

    FirstAttendanceNoticeSchema notice;/*from   w  ww  . java2 s  .  c o  m*/

    String crt, jur, yr, info1, info2;

    for (Iterator iter = requestForTrialToPrintVector.iterator(); iter.hasNext();) {
        RequestForTrialAdditionalCaseNumber additionalCaseNumber = (RequestForTrialAdditionalCaseNumber) iter
                .next();

        crt = additionalCaseNumber.getCrt();
        jur = additionalCaseNumber.getJur();
        yr = additionalCaseNumber.getYr();
        info1 = additionalCaseNumber.getInfoPart1();
        info2 = additionalCaseNumber.getInfoPart2();

        //if there is a case number i.e. it might be empty thus must check
        if (null != crt && !crt.equals("") && null != jur && !jur.equals("")) {

            firstAttendanceNoticeParameterFields = new FirstAttendanceNoticeParameterFields();

            try {
                firstAttendanceNoticeParameterFields.setTrailScheduleDetails(crt, jur, yr, info1, info2,
                        //TODO set boolean runAsStandAlone properly
                        false, request);

                firstAttendanceNoticeParameterFields.processParameterFieldsData();

                notice = new FirstAttendanceNoticeSchema();
                notice.setOffenceNumber(firstAttendanceNoticeParameterFields.getParamOffenceNumber());
                notice.setOffenceDate(firstAttendanceNoticeParameterFields.getParamOffenceDate());
                notice.setOfficerNumber(firstAttendanceNoticeParameterFields.getParamOfficerNumber());
                notice.setDriversLicenseNumber(
                        firstAttendanceNoticeParameterFields.getParamDriversLicenseNumber());
                notice.setPlateNumber(firstAttendanceNoticeParameterFields.getParamPlateNumber());
                notice.setEnforcementAgency(firstAttendanceNoticeParameterFields.getParamEnforcementAgency());
                notice.setSex(firstAttendanceNoticeParameterFields.getParamSex());
                notice.setDateOfBirth(firstAttendanceNoticeParameterFields.getParamDateOfBirth());
                notice.setCvor(firstAttendanceNoticeParameterFields.getParamCVOR());
                notice.setUnit(firstAttendanceNoticeParameterFields.getParamUnit());
                notice.setOffenderFullName(firstAttendanceNoticeParameterFields.getParamOffenderFullName());
                notice.setAddressLine1(firstAttendanceNoticeParameterFields.getParamAddressLine1());
                notice.setAddressLine2(firstAttendanceNoticeParameterFields.getParamAddressLine2());
                notice.setAddressLine3(firstAttendanceNoticeParameterFields.getParamAddressLine3());

                notice.setLanguageDesc(firstAttendanceNoticeParameterFields.getParamLanguageDesc());
                notice.setLanguageDesc_FR(firstAttendanceNoticeParameterFields.getParamLanguageDesc_FR());

                notice.setTrialDay(firstAttendanceNoticeParameterFields.getParamTrialDay());
                notice.setTrialMonth(firstAttendanceNoticeParameterFields.getParamTrialMonth());
                notice.setTrailYear(firstAttendanceNoticeParameterFields.getParamTrailYear());
                notice.setTrailTime(firstAttendanceNoticeParameterFields.getParamTrailTime());
                notice.setTrailLocation(firstAttendanceNoticeParameterFields.getParamTrailLocation());
                notice.setPhoneNumer(firstAttendanceNoticeParameterFields.getParamPhoneNumer());

                notice.setOffenceDesc(firstAttendanceNoticeParameterFields.getParamOffenceDesc());
                /* 2010-11-23 CR4372 French NoT FORM modifications
                 * This is the best place to manipulate the data i.e. pad the 
                 * statute description and offence description with spaces 
                 * given the total length is greater than 71 char 
                 * At this point the logic is concerned with the View 
                 * (in the MVC) so we are massaging the data to meet the 
                 * View requirements. Again the only place 
                 * concerned with the View business logic is this part and 
                 * isolating it from affecting other business logic not concerned 
                 * with the View requirements and how we display the data.
                 */
                String offenceStatDescCombined = firstAttendanceNoticeParameterFields.getParamOffenceDesc()
                        .trim() + ", " + firstAttendanceNoticeParameterFields.getParamOffenceStatue().trim();

                if (offenceStatDescCombined.length() <= 71) {
                    //offenceStatDescCombined = StringUtils.leftPad(offenceStatDescCombined, 120, "E");
                    offenceStatDescCombined = "\n" + offenceStatDescCombined;
                }

                notice.setOffenceStatue(offenceStatDescCombined);
                notice.setOffenceSection(firstAttendanceNoticeParameterFields.getParamOffenceSection());
                //2012-09-19 French NoT, Red NoT, ER, and EP Changes
                notice.setOffenceLocation(firstAttendanceNoticeParameterFields.getParamOffenceLocation());

                notice.setInterpreterLanguage(
                        firstAttendanceNoticeParameterFields.getParamInterpreterLanguage());

                //Added Apr 20, 2012 - Anan
                notice.setIssuedDay(firstAttendanceNoticeParameterFields.getParamIssuedDay());
                notice.setIssuedMonth(firstAttendanceNoticeParameterFields.getParamIssuedMonth());
                notice.setIssuedYear(firstAttendanceNoticeParameterFields.getParamIssuedYear());
                //2012-09-19 French NoT, Red NoT, ER, and EP Changes
                notice.setIssuedAt(firstAttendanceNoticeParameterFields.getParamIssuedAt());

                notices.add(notice);

            } catch (Exception e) {
                e.printStackTrace();
                //returnMessage = "Request for Trial Was Not Retrieving Successful";
            }

        } //END if (null != crt && !crt.equals("")...
    } //END for (Iterator iter = requestForTrialToPrintVector.iterator()...      

    return notices;
}

From source file:nl.imvertor.ReadmeCompiler.ReadmeCompiler.java

/**
 * Return all files paths as ;-separated string.
 * // ww w  .  j  a v  a 2 s  .  c om
 * @param folderPath The folder to search, recursively
 * @param prefix A path to prefix before the subpath of the file found.
 * @return String holding all (sub)paths.
 * @throws Exception
 */

private String listFiles(String folderPath, String prefix) throws Exception {
    AnyFolder folder = new AnyFolder(folderPath);
    if (folder != null && folder.isDirectory()) {
        String base = folder.toURI().toString();
        Vector<String> list1 = folder.listFilesToVector(true);
        Iterator<String> it = list1.iterator();
        String list2 = "";
        while (it.hasNext()) {
            File f = new File(it.next());
            list2 += prefix + StringUtils.substringAfter(f.toURI().toString(), base);
            list2 += (it.hasNext()) ? ";" : "";
        }
        return list2;
    } else
        return "";
}

From source file:de.unibayreuth.bayeos.goat.table.OctetMatrixTableModel.java

private Vector getIds(Vector s) {
    Iterator it = s.iterator();
    Vector ret = new Vector(s.capacity());
    while (it.hasNext()) {
        ret.add(((ObjektNode) it.next()).getId());
    }//from ww w.j  a v a 2 s. c om
    return ret;
}

From source file:tufts.vue.PublishUtil.java

public static File createIMSCP(Vector resourceVector)
        throws IOException, URISyntaxException, CloneNotSupportedException {
    String IMSCPMetadata = "";
    String IMSCPOrganization = "";
    String IMSCPResources = "";
    int resourceCount = 2; //resourceIdentifier 1 is used for map
    Properties props = tufts.vue.VUE.getActiveMap().getMetadata().asProperties();
    IMSCPMetadata += getMetadataString(props);
    IMSCPResources += getResourceTag(props, IMSCP.MAP_FILE, 1);
    IMSCPOrganization += "<organization identifier=\"TOC1\" structure=\"hierarchical\">";
    IMSCPOrganization += "<title>IMS Content Package of VUE Map</title> ";
    IMSCPOrganization += "<item identifier=\"ITEM1\" identifierref=\"RESOURCE1\">";
    IMSCPOrganization += "<title> VUE Cocept Map</title>";
    LWMap saveMap = (LWMap) tufts.vue.VUE.getActiveMap().clone();
    IMSCP imscp = new IMSCP();
    Iterator i = resourceVector.iterator();
    while (i.hasNext()) {
        Vector vector = (Vector) i.next();
        Resource r = (Resource) (vector.elementAt(1));
        Boolean b = (Boolean) (vector.elementAt(0));
        File file = new File(new URL(r.getSpec()).getFile());
        //File file = new File((String)vector.elementAt(1));
        if (b.booleanValue()) {
            System.out.println("FileName = " + file.getName() + " index =" + resourceVector.indexOf(vector));
            //resourceTable.setValueAt("Processing",resourceVector.indexOf(vector),STATUS_COL);
            String entry = IMSCP.RESOURCE_FILES + File.separator + file.getName();
            imscp.putEntry(entry, file);
            IMSCPResources += getResourceTag(r.getProperties().asProperties(), entry, resourceCount);
            IMSCPOrganization += getItemTag("ITEM" + resourceCount, "RESOURCE" + resourceCount,
                    "Resource " + resourceCount + " in Concept Map");
            //resourceTable.setValueAt("Done",resourceVector.indexOf(vector),STATUS_COL);
            replaceResource(saveMap, r,/*  w w w.j  a  v  a2  s .  com*/
                    Resource.getFactory().get(IMSCP.RESOURCE_FILES + File.separatorChar + file.getName()));
            //replaceResource(saveMap,r,new MapResource(IMSCP.RESOURCE_FILES+File.separatorChar+file.getName()));
            resourceCount++;
        }
    }
    saveMap(saveMap);
    imscp.putEntry(IMSCP.MAP_FILE, activeMapFile);
    IMSCPOrganization += "</item>";
    IMSCPOrganization += "</organization>";
    IMSManifest = readRawManifest();
    IMSManifest = IMSManifest.replaceAll(IMSCP_MANIFEST_METADATA, IMSCPMetadata).trim();
    IMSManifest = IMSManifest.replaceAll(IMSCP_MANIFEST_ORGANIZATION, IMSCPOrganization);
    IMSManifest = IMSManifest.replaceAll(IMSCP_MANIFEST_RESOURCES, IMSCPResources);

    File IMSManifestFile = File.createTempFile("imsmanifest", ".xml");
    BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(IMSManifestFile));
    fos.write(IMSManifest.getBytes());
    fos.close();
    imscp.putEntry(IMSCP.MANIFEST_FILE, IMSManifestFile);
    System.out.println("Writing Active Map : " + activeMapFile.getName());
    imscp.closeZOS();
    return imscp.getFile();
}

From source file:com.concursive.connect.web.modules.wiki.jobs.WikiExporterJob.java

protected WikiExportBean getExisting(File checkFile, Vector collectionToCheck) throws Exception {
    Iterator i = collectionToCheck.iterator();
    while (i.hasNext()) {
        WikiExportBean bean = (WikiExportBean) i.next();
        if (bean.getExportedFile().toURL().equals(checkFile.toURL())) {
            return bean;
        }/* w w  w .  j a v  a2  s .  c  o  m*/
    }
    return null;
}

From source file:com.ibm.xsp.xflow.activiti_rest.DominoGroupManager.java

@Override
public List<Group> findGroupsByUser(String userId) {
    List<Group> groupList = new ArrayList<Group>();
    Session session = null;/*from   ww w.j  ava  2 s. co m*/
    try {
        NotesThread.sinitThread();
        session = NotesFactory.createSessionWithFullAccess();
        Vector<Name> names = session.getUserGroupNameList();
        Iterator<Name> it = names.iterator();
        while (it.hasNext()) {
            Group group = new GroupEntity();
            String groupName = it.next().getAbbreviated();
            group.setId(groupName);
            group.setName(groupName);
            group.setType("security-role");
            groupList.add(group);
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (session != null)
                session.recycle();
        } catch (Exception e) {

        }
        NotesThread.stermThread();
    }
    return groupList;
}

From source file:com.googlecode.gmaps4jsf.jsfplugin.mojo.TagMojo.java

private void writePropertySetters(BufferedWriter writer, Vector attributes) throws IOException {
    for (Iterator iterator = attributes.iterator(); iterator.hasNext();) {
        Attribute attribute = (Attribute) iterator.next();
        if (isIgnored(attribute, uicomponentAttributes))
            continue;

        writer.write("\tpublic void set" + attribute.getName().substring(0, 1).toUpperCase()
                + attribute.getName().substring(1) + "(String value){\n");
        writer.write("\t\t_" + attribute.getName() + " = value;\n");
        writer.write("\t}\n\n");
    }//from w ww  . j a v  a  2 s .  c o m
}

From source file:graficos.GraficoGantt.java

private void agregarTareasFicticias(Hashtable<Integer, Date> actFecha_com,
        Hashtable<Integer, Date> actFecha_fin, Vector<Actividad> vec_ficticias) {
    for (Iterator<Actividad> it = vec_ficticias.iterator(); it.hasNext();) {
        Actividad a = it.next();/*from  w  w w  .  j  a  va2 s. c  o  m*/
        Vector<Actividad> vec_ent = a.getSucesoOrigen().getActividadesEntrantes();
        Vector<Actividad> vec_sal = a.getSucesoFin().getActividadesSalientes();
        boolean listo_fc = false;
        boolean listo_ff = false;
        Date fecha_com = new Date();
        Date fecha_fin = new Date();
        for (Iterator<Actividad> it0 = vec_ent.iterator(); it0.hasNext() && !listo_fc;) {
            Actividad ae = it0.next();
            if (!ae.esFicticia()) {
                fecha_com = actFecha_fin.get(ae.getIdentificador());
                listo_fc = true;
            }
        }
        for (Iterator<Actividad> it0 = vec_sal.iterator(); it0.hasNext() && !listo_ff;) {
            Actividad as = it0.next();
            if (!as.esFicticia()) {
                fecha_fin = actFecha_com.get(as.getIdentificador());
                listo_ff = true;
            }
        }
        if (listo_fc && listo_ff) {
            Task tarea = new Task("F (" + a.getIdentificador().toString() + ") " + a.getDescripcion(),
                    new SimpleTimePeriod(fecha_com, fecha_fin));
            serie_tareas_nc.add(tarea);
        }
    }
}

From source file:org.jamwiki.parser.jflex.WikiReferenceTag.java

/**
 *
 *///from   w  ww.j  a v a2 s  .com
private WikiReference buildReference(ParserInput parserInput, String raw) {
    String name = buildReferenceName(raw);
    String content = ParserUtil.tagContent(raw);
    Vector references = this.retrieveReferences(parserInput);
    int count = 0;
    int citation = 1;
    for (Iterator iterator = references.iterator(); iterator.hasNext();) {
        // loop through existing attributes to determine max citation number,
        // or if a named reference the citation and count number
        WikiReference temp = (WikiReference) iterator.next();
        if (temp.getName() != null && name != null && name.equals(temp.getName())) {
            count++;
            citation = temp.getCitation();
        }
        if (count == 0 && citation <= temp.getCitation()) {
            citation = temp.getCitation() + 1;
        }
    }
    WikiReference reference = new WikiReference(name, content, citation, count);
    return reference;
}

From source file:graficos.GraficoGantt.java

private void agregarTareasConcretas(Suceso suceso, Date fecha_com, int unidad_tiempo) {
    Vector<Actividad> vec = suceso.getActividadesSalientes();
    for (Iterator<Actividad> it = vec.iterator(); it.hasNext();) {
        Actividad a = it.next();//  ww w  .  j  a v  a 2s .co  m
        if (!a.esFicticia()) {
            Date fecha_fin = getFechaIncremento(fecha_com, unidad_tiempo,
                    a.getParametrosNormales().getTiempo());
            Task tarea;
            if (a.esCritica()) {
                tarea = new Task("(" + a.getIdentificador().toString() + ") " + a.getDescripcion(),
                        new SimpleTimePeriod((Date) fecha_com.clone(), fecha_fin));
                serie_tareas_c.add(tarea);
            } else {
                tarea = new Task("(" + a.getIdentificador().toString() + ") " + a.getDescripcion(),
                        new SimpleTimePeriod((Date) fecha_com.clone(), fecha_fin));
                serie_tareas_nc.add(tarea);
            }
            agregarTareasConcretas(a.getSucesoFin(), fecha_fin, unidad_tiempo);
        } else
            agregarTareasConcretas(a.getSucesoFin(), fecha_com, unidad_tiempo);
    }
}