Example usage for java.util ArrayList listIterator

List of usage examples for java.util ArrayList listIterator

Introduction

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

Prototype

public ListIterator<E> listIterator() 

Source Link

Document

Returns a list iterator over the elements in this list (in proper sequence).

Usage

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BaseDomainTable.java

public MSSBamBaseDomainBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) {
    final String S_ProcName = "readDerivedByScopeIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*w  w  w.j  a  va2 s  .com*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBaseDomainDistinctClassCode + "WHERE "
                + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamBaseDomainBuff> resultList = new ArrayList<MSSBamBaseDomainBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BDM")) {
            MSSBamBaseDomainBuff[] subList = readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("DOM")) {
            MSSBamDomainBuff[] subList = schema.getTableDomain().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = schema.getTableLegalEntity().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("PRJ")) {
            MSSBamProjectBuff[] subList = schema.getTableProject().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VER")) {
            MSSBamVersionBuff[] subList = schema.getTableVersion().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJV")) {
            MSSBamMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNV")) {
            MSSBamMinorVersionBuff[] subList = schema.getTableMinorVersion().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TLD")) {
            MSSBamTLDBuff[] subList = schema.getTableTLD().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamBaseDomainBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8LegalEntityTable.java

public MSSBamLegalEntityBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) {
    final String S_ProcName = "readDerivedByAuthorIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/* w w  w.  j  a  v  a  2s  . c om*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectLegalEntityDistinctClassCode + "WHERE "
                + ((AuthorId == null) ? "anyo.AuthorId is null "
                        : "anyo.AuthorId = " + AuthorId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamLegalEntityBuff> resultList = new ArrayList<MSSBamLegalEntityBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamLegalEntityBuff[0]));

}

From source file:ffx.potential.MolecularAssembly.java

/**
 * {@inheritDoc}/*w ww  .  ja  v a2s.c  o m*/
 */
@Override
public void finalize(boolean finalizeGroups, ForceField forceField) {
    setFinalized(false);
    if (finalizeGroups) {
        bondTime = 0;
        angleTime = 0;
        stretchBendTime = 0;
        ureyBradleyTime = 0;
        outOfPlaneBendTime = 0;
        torsionTime = 0;
        piOrbitalTorsionTime = 0;
        torsionTorsionTime = 0;
        ArrayList Polymers = getAtomNodeList();
        for (ListIterator li = Polymers.listIterator(); li.hasNext();) {
            MSGroup group = (MSGroup) li.next();
            if (logger.isLoggable(Level.FINE)) {
                logger.fine(" Finalizing bonded terms for polymer " + group.toString());
            }
            try {
                group.finalize(true, forceField);
            } catch (Exception e) {
                String message = "Fatal exception finalizing " + group.toString();
                logger.log(Level.SEVERE, message, e);
                System.exit(-1);
            }
            if (logger.isLoggable(Level.FINE)) {
                Runtime runtime = Runtime.getRuntime();
                long occupiedMemory = runtime.totalMemory() - runtime.freeMemory();
                long MB = 1024 * 1024;
                logger.fine("\n In-Use Memory   (Mb): " + occupiedMemory / MB + "\n Free Memory     (Mb): "
                        + runtime.freeMemory() / MB + "\n Total Memory    (Mb): " + runtime.totalMemory() / MB);
            }
        }
        for (MSNode m : molecules.getChildList()) {
            Molecule molecule = (Molecule) m;
            molecule.finalize(true, forceField);
        }
        for (MSNode m : water.getChildList()) {
            Molecule molecule = (Molecule) m;
            molecule.finalize(true, forceField);
        }
        for (MSNode m : ions.getChildList()) {
            Molecule molecule = (Molecule) m;
            molecule.finalize(true, forceField);
        }
        if (logger.isLoggable(Level.FINE)) {
            StringBuilder sb = new StringBuilder("\n Time to create bonded energy terms\n\n");
            sb.append(String.format(" Bond Streching     %10.3f\n", bondTime * 1.0e-9));
            sb.append(String.format(" Angle Bending      %10.3f\n", angleTime * 1.0e-9));
            sb.append(String.format(" Stretch-Bend       %10.3f\n", stretchBendTime * 1.0e-9));
            sb.append(String.format(" Urey-Bradley       %10.3f\n", ureyBradleyTime * 1.0e-9));
            sb.append(String.format(" Out-of-Plane Bend  %10.3f\n", outOfPlaneBendTime * 1.0e-9));
            sb.append(String.format(" Torsionanl Angle   %10.3f\n", torsionTime * 1.0e-9));
            sb.append(String.format(" Pi-Orbital Torsion %10.3f\n", piOrbitalTorsionTime * 1.0e-9));
            sb.append(String.format(" Torsion-Torsion    %10.3f\n", torsionTorsionTime * 1.0e-9));
            logger.fine(sb.toString());
        }
    }
    if (!java.awt.GraphicsEnvironment.isHeadless()) {
        createScene(!finalizeGroups);
        center();
    }
    removeLeaves();
    setFinalized(true);
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8DomainTable.java

public MSSBamDomainBuff[] readDerivedByTenantIdx(MSSBamAuthorization Authorization, long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from w ww.jav  a 2 s.com*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectDomainDistinctClassCode + "WHERE " + "anyo.TenantId = "
                + Long.toString(TenantId) + " ";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamDomainBuff> resultList = new ArrayList<MSSBamDomainBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("DOM")) {
            MSSBamDomainBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = schema.getTableLegalEntity().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("PRJ")) {
            MSSBamProjectBuff[] subList = schema.getTableProject().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VER")) {
            MSSBamVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJV")) {
            MSSBamMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNV")) {
            MSSBamMinorVersionBuff[] subList = schema.getTableMinorVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamDomainBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BaseDomainTable.java

public MSSBamBaseDomainBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) {
    final String S_ProcName = "readDerivedByAuthorIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  ww  w.  ja  v  a2s  .  c o  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBaseDomainDistinctClassCode + "WHERE "
                + ((AuthorId == null) ? "anyo.AuthorId is null "
                        : "anyo.AuthorId = " + AuthorId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamBaseDomainBuff> resultList = new ArrayList<MSSBamBaseDomainBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BDM")) {
            MSSBamBaseDomainBuff[] subList = readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("DOM")) {
            MSSBamDomainBuff[] subList = schema.getTableDomain().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = schema.getTableLegalEntity().readBuffByAuthorIdx(Authorization,
                    AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("PRJ")) {
            MSSBamProjectBuff[] subList = schema.getTableProject().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VER")) {
            MSSBamVersionBuff[] subList = schema.getTableVersion().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJV")) {
            MSSBamMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByAuthorIdx(Authorization,
                    AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNV")) {
            MSSBamMinorVersionBuff[] subList = schema.getTableMinorVersion().readBuffByAuthorIdx(Authorization,
                    AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TLD")) {
            MSSBamTLDBuff[] subList = schema.getTableTLD().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamBaseDomainBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8LegalEntityTable.java

public MSSBamLegalEntityBuff[] readDerivedByContainerIdx(MSSBamAuthorization Authorization,
        Long ContainerDomainId) {
    final String S_ProcName = "readDerivedByContainerIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from w  w  w .  java2  s.  c  om
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectLegalEntityDistinctClassCode + "WHERE "
                + ((ContainerDomainId == null) ? "dom.ContainerDomainId is null "
                        : "dom.ContainerDomainId = " + ContainerDomainId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamLegalEntityBuff> resultList = new ArrayList<MSSBamLegalEntityBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = readBuffByContainerIdx(Authorization, ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByContainerIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByContainerIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamLegalEntityBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8LegalEntityTable.java

public MSSBamLegalEntityBuff[] readDerivedByChildrenIdx(MSSBamAuthorization Authorization,
        Long ContainerDomainId) {
    final String S_ProcName = "readDerivedByChildrenIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }// www.j a  v  a  2s.c  o m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectLegalEntityDistinctClassCode + "WHERE "
                + ((ContainerDomainId == null) ? "lent.container_dom_id is null "
                        : "lent.container_dom_id = " + ContainerDomainId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamLegalEntityBuff> resultList = new ArrayList<MSSBamLegalEntityBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = readBuffByChildrenIdx(Authorization, ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByChildrenIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByChildrenIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamLegalEntityBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8DomainTable.java

public MSSBamDomainBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) {
    final String S_ProcName = "readDerivedByScopeIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from w w  w . ja va 2  s .c o  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectDomainDistinctClassCode + "WHERE "
                + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamDomainBuff> resultList = new ArrayList<MSSBamDomainBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("DOM")) {
            MSSBamDomainBuff[] subList = readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = schema.getTableLegalEntity().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("PRJ")) {
            MSSBamProjectBuff[] subList = schema.getTableProject().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VER")) {
            MSSBamVersionBuff[] subList = schema.getTableVersion().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJV")) {
            MSSBamMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNV")) {
            MSSBamMinorVersionBuff[] subList = schema.getTableMinorVersion().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamDomainBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8DomainTable.java

public MSSBamDomainBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) {
    final String S_ProcName = "readDerivedByAuthorIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   www .  j av  a  2  s.c  o m*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectDomainDistinctClassCode + "WHERE "
                + ((AuthorId == null) ? "anyo.AuthorId is null "
                        : "anyo.AuthorId = " + AuthorId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamDomainBuff> resultList = new ArrayList<MSSBamDomainBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("DOM")) {
            MSSBamDomainBuff[] subList = readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = schema.getTableLegalEntity().readBuffByAuthorIdx(Authorization,
                    AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("PRJ")) {
            MSSBamProjectBuff[] subList = schema.getTableProject().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VER")) {
            MSSBamVersionBuff[] subList = schema.getTableVersion().readBuffByAuthorIdx(Authorization, AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJV")) {
            MSSBamMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByAuthorIdx(Authorization,
                    AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNV")) {
            MSSBamMinorVersionBuff[] subList = schema.getTableMinorVersion().readBuffByAuthorIdx(Authorization,
                    AuthorId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamDomainBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8DomainTable.java

public MSSBamDomainBuff[] readDerivedByContainerIdx(MSSBamAuthorization Authorization, Long ContainerDomainId) {
    final String S_ProcName = "readDerivedByContainerIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   w  w w .  ja  v  a2 s .c  om*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectDomainDistinctClassCode + "WHERE "
                + ((ContainerDomainId == null) ? "dom.ContainerDomainId is null "
                        : "dom.ContainerDomainId = " + ContainerDomainId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamDomainBuff> resultList = new ArrayList<MSSBamDomainBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("DOM")) {
            MSSBamDomainBuff[] subList = readBuffByContainerIdx(Authorization, ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("LENT")) {
            MSSBamLegalEntityBuff[] subList = schema.getTableLegalEntity().readBuffByContainerIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("COM")) {
            MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByContainerIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("USR")) {
            MSSBamUserBuff[] subList = schema.getTableUser().readBuffByContainerIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("PRJ")) {
            MSSBamProjectBuff[] subList = schema.getTableProject().readBuffByContainerIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VER")) {
            MSSBamVersionBuff[] subList = schema.getTableVersion().readBuffByContainerIdx(Authorization,
                    ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJV")) {
            MSSBamMajorVersionBuff[] subList = schema.getTableMajorVersion()
                    .readBuffByContainerIdx(Authorization, ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNV")) {
            MSSBamMinorVersionBuff[] subList = schema.getTableMinorVersion()
                    .readBuffByContainerIdx(Authorization, ContainerDomainId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamDomainBuff[0]));

}