Example usage for java.util LinkedList iterator

List of usage examples for java.util LinkedList iterator

Introduction

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

Prototype

Iterator<E> iterator();

Source Link

Document

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

Usage

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskRam.CFAsteriskRamServiceTypeTable.java

public void deleteServiceTypeByIdIdx(CFSecurityAuthorization Authorization, CFSecurityServiceTypePKey argKey) {
    CFSecurityServiceTypeBuff cur;/* w  ww. ja  va  2s.  co m*/
    LinkedList<CFSecurityServiceTypeBuff> matchSet = new LinkedList<CFSecurityServiceTypeBuff>();
    Iterator<CFSecurityServiceTypeBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFSecurityServiceTypeBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        deleteServiceType(Authorization, cur);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamRam.CFBamRamMimeTypeTable.java

public void deleteMimeTypeByUNameIdx(CFSecurityAuthorization Authorization,
        CFInternetMimeTypeByUNameIdxKey argKey) {
    CFInternetMimeTypeBuff cur;//from  ww w  . j av  a2 s  .  co  m
    boolean anyNotNull = false;
    anyNotNull = true;
    if (!anyNotNull) {
        return;
    }
    LinkedList<CFInternetMimeTypeBuff> matchSet = new LinkedList<CFInternetMimeTypeBuff>();
    Iterator<CFInternetMimeTypeBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFInternetMimeTypeBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        cur = schema.getTableMimeType().readDerivedByIdIdx(Authorization, cur.getRequiredMimeTypeId());
        deleteMimeType(Authorization, cur);
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskRam.CFAsteriskRamAuditActionTable.java

public void deleteAuditActionByUDescrIdx(CFSecurityAuthorization Authorization,
        CFSecurityAuditActionByUDescrIdxKey argKey) {
    CFSecurityAuditActionBuff cur;/* www  .j a  va 2 s . c  o m*/
    LinkedList<CFSecurityAuditActionBuff> matchSet = new LinkedList<CFSecurityAuditActionBuff>();
    Iterator<CFSecurityAuditActionBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFSecurityAuditActionBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        deleteAuditAction(Authorization, cur);
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskRam.CFAsteriskRamServiceTypeTable.java

public void deleteServiceTypeByUDescrIdx(CFSecurityAuthorization Authorization,
        CFSecurityServiceTypeByUDescrIdxKey argKey) {
    CFSecurityServiceTypeBuff cur;//from w  w w .  j  a va 2  s.  c o  m
    LinkedList<CFSecurityServiceTypeBuff> matchSet = new LinkedList<CFSecurityServiceTypeBuff>();
    Iterator<CFSecurityServiceTypeBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFSecurityServiceTypeBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        deleteServiceType(Authorization, cur);
    }
}

From source file:mase.spec.BasicHybridExchanger.java

protected Individual[] pickIndividuals(Individual[] pool, int num, PickMode mode, EvolutionState state) {
    Individual[] picked = new Individual[num];
    if (mode == PickMode.first) {
        System.arraycopy(pool, 0, picked, 0, num);
    } else if (mode == PickMode.elite) {
        Individual[] sorted = sortedCopy(pool);
        System.arraycopy(sorted, 0, picked, 0, num);
    } else if (mode == PickMode.probabilistic) {
        double total = 0;
        LinkedList<Individual> poolList = new LinkedList<>();
        for (Individual ind : pool) {
            poolList.add(ind);/*from  w w  w.  jav a  2s .co  m*/
            total += ((SimpleFitness) ind.fitness).fitness();
        }
        int index = 0;
        while (index < num) {
            double accum = 0;
            double rand = state.random[0].nextDouble() * total;
            Iterator<Individual> iter = poolList.iterator();
            while (iter.hasNext()) {
                Individual ind = iter.next();
                accum += ((SimpleFitness) ind.fitness).fitness();
                if (accum >= rand) {
                    picked[index++] = ind;
                    iter.remove();
                    total -= ((SimpleFitness) ind.fitness).fitness();
                    break;
                }
            }
        }
    } else if (mode == PickMode.random) {
        LinkedList<Individual> poolList = new LinkedList<>(Arrays.asList(pool));
        int index = 0;
        while (index < num) {
            int rand = state.random[0].nextInt(poolList.size());
            picked[index++] = poolList.get(rand);
            poolList.remove(rand);
        }
    } else {
        state.output.fatal("Unknown picking mode: " + mode);
    }
    return picked;
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxRam.CFEnSyntaxRamServiceTypeTable.java

public void deleteServiceTypeByIdIdx(CFEnSyntaxAuthorization Authorization, CFEnSyntaxServiceTypePKey argKey) {
    CFEnSyntaxServiceTypeBuff cur;/* w  w w  .j a  v a 2s  . c om*/
    LinkedList<CFEnSyntaxServiceTypeBuff> matchSet = new LinkedList<CFEnSyntaxServiceTypeBuff>();
    Iterator<CFEnSyntaxServiceTypeBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFEnSyntaxServiceTypeBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        deleteServiceType(Authorization, cur);
    }
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxRam.CFEnSyntaxRamServiceTypeTable.java

public void deleteServiceTypeByUDescrIdx(CFEnSyntaxAuthorization Authorization,
        CFEnSyntaxServiceTypeByUDescrIdxKey argKey) {
    CFEnSyntaxServiceTypeBuff cur;/*from ww  w  . j a v a2 s.  co  m*/
    LinkedList<CFEnSyntaxServiceTypeBuff> matchSet = new LinkedList<CFEnSyntaxServiceTypeBuff>();
    Iterator<CFEnSyntaxServiceTypeBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFEnSyntaxServiceTypeBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        deleteServiceType(Authorization, cur);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamRam.CFBamRamServiceTypeTable.java

public void deleteServiceTypeByIdIdx(CFSecurityAuthorization Authorization, CFSecurityServiceTypePKey argKey) {
    boolean anyNotNull = false;
    anyNotNull = true;//from   w  w w  .j  a va 2 s .c  om
    if (!anyNotNull) {
        return;
    }
    CFSecurityServiceTypeBuff cur;
    LinkedList<CFSecurityServiceTypeBuff> matchSet = new LinkedList<CFSecurityServiceTypeBuff>();
    Iterator<CFSecurityServiceTypeBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFSecurityServiceTypeBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        cur = schema.getTableServiceType().readDerivedByIdIdx(Authorization, cur.getRequiredServiceTypeId());
        deleteServiceType(Authorization, cur);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamRam.CFBamRamServiceTypeTable.java

public void deleteServiceTypeByUDescrIdx(CFSecurityAuthorization Authorization,
        CFSecurityServiceTypeByUDescrIdxKey argKey) {
    CFSecurityServiceTypeBuff cur;/*from  w  w w .j a  va  2 s. co m*/
    boolean anyNotNull = false;
    anyNotNull = true;
    if (!anyNotNull) {
        return;
    }
    LinkedList<CFSecurityServiceTypeBuff> matchSet = new LinkedList<CFSecurityServiceTypeBuff>();
    Iterator<CFSecurityServiceTypeBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFSecurityServiceTypeBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        cur = schema.getTableServiceType().readDerivedByIdIdx(Authorization, cur.getRequiredServiceTypeId());
        deleteServiceType(Authorization, cur);
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamVersionTable.java

public void deleteVersionByIdIdx(CFAccAuthorization Authorization, CFAccDomainBasePKey argKey) {
    final String S_ProcName = "deleteVersionByIdIdx";
    CFAccVersionBuff cur;/*  w w  w  . java 2s  .  c o  m*/
    LinkedList<CFAccVersionBuff> matchSet = new LinkedList<CFAccVersionBuff>();
    Iterator<CFAccVersionBuff> values = dictByPKey.values().iterator();
    while (values.hasNext()) {
        cur = values.next();
        if (argKey.equals(cur)) {
            matchSet.add(cur);
        }
    }
    Iterator<CFAccVersionBuff> iterMatch = matchSet.iterator();
    while (iterMatch.hasNext()) {
        cur = iterMatch.next();
        String subClassCode = cur.getClassCode();
        if ("VERN".equals(subClassCode)) {
            schema.getTableVersion().deleteVersion(Authorization, cur);
        } else if ("MJVR".equals(subClassCode)) {
            schema.getTableMajorVersion().deleteMajorVersion(Authorization, (CFAccMajorVersionBuff) cur);
        } else if ("MNVR".equals(subClassCode)) {
            schema.getTableMinorVersion().deleteMinorVersion(Authorization, (CFAccMinorVersionBuff) cur);
        } else {
            throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName,
                    "subClassCode", cur,
                    "Instance of or subclass of Version must not be \"" + subClassCode + "\"");
        }
    }
}