Example usage for java.util SortedMap size

List of usage examples for java.util SortedMap size

Introduction

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

Prototype

int size();

Source Link

Document

Returns the number of key-value mappings in this map.

Usage

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamHostNodeTable.java

public CFAstHostNodeBuff[] readDerivedByClusterIdx(CFAstAuthorization Authorization, long ClusterId) {
    final String S_ProcName = "CFAstRamHostNode.readDerivedByClusterIdx() ";
    CFAstHostNodeByClusterIdxKey key = schema.getFactoryHostNode().newClusterIdxKey();
    key.setRequiredClusterId(ClusterId);

    CFAstHostNodeBuff[] recArray;/*w ww  .  j ava  2s . co  m*/
    if (dictByClusterIdx.containsKey(key)) {
        SortedMap<CFAstHostNodePKey, CFAstHostNodeBuff> subdictClusterIdx = dictByClusterIdx.get(key);
        recArray = new CFAstHostNodeBuff[subdictClusterIdx.size()];
        Iterator<CFAstHostNodeBuff> iter = subdictClusterIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAstHostNodeBuff[0];
    }
    return (recArray);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgClient.CFAccXMsgClientAccountContactTable.java

public CFAccAccountContactBuff[] readDerivedByCtctLstIdx(CFAccAuthorization Authorization, long argTenantId,
        long argContactListId) {
    final String S_ProcName = "readDerivedByCtctLstIdx";
    String rqst = CFAccXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t"
            + CFAccXMsgAccountContactMessageFormatter.formatAccountContactRqstReadByCtctLstIdx("\n\t\t\t",
                    argTenantId, argContactListId)
            + "\n" + CFAccXMsgSchemaMessageFormatter.formatRqstXmlPostamble();
    String rspn = schema.sendReceive(Authorization, rqst);
    if ((rspn == null) || (rspn.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn");
    }/*from   w  w  w  .j  av a 2 s .  c  om*/
    CFAccXMsgRspnHandler responseHandler = schema.getResponseHandler();
    responseHandler.parseStringContents(rspn);
    CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised();
    if (exceptionRaised != null) {
        throw exceptionRaised;
    }
    Object sortedMapObj = responseHandler.getSortedMapOfObjects();
    if (sortedMapObj == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                "responseHandler.getSortedMapOfObjects");
    }
    SortedMap<CFAccAccountContactPKey, ICFAccAccountContactObj> sortedMap = (SortedMap<CFAccAccountContactPKey, ICFAccAccountContactObj>) sortedMapObj;
    int sz = sortedMap.size();
    CFAccAccountContactBuff arr[] = new CFAccAccountContactBuff[sz];
    Iterator<ICFAccAccountContactObj> iter = sortedMap.values().iterator();
    ICFAccAccountContactObj cur;
    for (int idx = 0; idx < sz; idx++) {
        cur = (ICFAccAccountContactObj) iter.next();
        arr[idx] = cur.getAccountContactBuff();
    }
    return (arr);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgClient.CFAccXMsgClientAccountContactTable.java

public CFAccAccountContactBuff[] readDerivedByCtctIdx(CFAccAuthorization Authorization, long argTenantId,
        long argContactId) {
    final String S_ProcName = "readDerivedByCtctIdx";
    String rqst = CFAccXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t"
            + CFAccXMsgAccountContactMessageFormatter.formatAccountContactRqstReadByCtctIdx("\n\t\t\t",
                    argTenantId, argContactId)
            + "\n" + CFAccXMsgSchemaMessageFormatter.formatRqstXmlPostamble();
    String rspn = schema.sendReceive(Authorization, rqst);
    if ((rspn == null) || (rspn.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn");
    }//from   w  w w.java2s.c  o m
    CFAccXMsgRspnHandler responseHandler = schema.getResponseHandler();
    responseHandler.parseStringContents(rspn);
    CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised();
    if (exceptionRaised != null) {
        throw exceptionRaised;
    }
    Object sortedMapObj = responseHandler.getSortedMapOfObjects();
    if (sortedMapObj == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                "responseHandler.getSortedMapOfObjects");
    }
    SortedMap<CFAccAccountContactPKey, ICFAccAccountContactObj> sortedMap = (SortedMap<CFAccAccountContactPKey, ICFAccAccountContactObj>) sortedMapObj;
    int sz = sortedMap.size();
    CFAccAccountContactBuff arr[] = new CFAccAccountContactBuff[sz];
    Iterator<ICFAccAccountContactObj> iter = sortedMap.values().iterator();
    ICFAccAccountContactObj cur;
    for (int idx = 0; idx < sz; idx++) {
        cur = (ICFAccAccountContactObj) iter.next();
        arr[idx] = cur.getAccountContactBuff();
    }
    return (arr);
}

From source file:com.aurel.track.fieldType.runtime.matchers.run.CompositeSelectMatcherRT.java

/**
 * Add a match expression to the criteria
 *///from ww  w .jav  a  2  s .  com
@Override
public void addCriteria(Criteria crit) {
    if (relation == MatchRelations.IS_NULL || relation == MatchRelations.NOT_IS_NULL) {
        String alias = addAliasAndJoin(crit);
        addNullExpressionToCriteria(crit, alias + "." + "CUSTOMOPTIONID");
        return;
    }
    SortedMap<Integer, Object> matcherValueMap = null;
    try {
        matcherValueMap = (SortedMap<Integer, Object>) matchValue;
    } catch (Exception e) {
        LOGGER.warn("Converting the matcher value of type " + matchValue.getClass().getName()
                + " to SortedMap<Integer, Object> failed with " + e.getMessage());
        LOGGER.debug(ExceptionUtils.getStackTrace(e));
    }
    if (matcherValueMap != null && matcherValueMap.size() != 0) {
        Iterator<Integer> iterator = matcherValueMap.keySet().iterator();
        Criterion criterion = null;
        while (iterator.hasNext()) {
            Integer parameterCode = iterator.next();
            Integer[] matcherValueCustomOption = null;
            try {
                matcherValueCustomOption = (Integer[]) matcherValueMap.get(parameterCode);
            } catch (Exception e) {
                LOGGER.error("Converting the matcher value for part " + parameterCode
                        + " to Integer[] failed with " + e.getMessage());
                LOGGER.debug(ExceptionUtils.getStackTrace(e));
                return;
            }
            if (matcherValueCustomOption == null || matcherValueCustomOption.length == 0) {
                matcherValueCustomOption = new Integer[0];
            }
            String alias = null;
            switch (relation) {
            case MatchRelations.EQUAL:
                alias = addAliasAndJoin(crit, parameterCode);
                crit.addIn(alias + "." + "CUSTOMOPTIONID", matcherValueCustomOption);
                break;
            case MatchRelations.NOT_EQUAL:
                alias = addAliasAndJoin(crit, parameterCode);
                if (criterion == null) {
                    criterion = crit.getNewCriterion(alias + "." + "CUSTOMOPTIONID", matcherValueCustomOption,
                            Criteria.NOT_IN);
                } else {
                    criterion = criterion.or(crit.getNewCriterion(alias + "." + "CUSTOMOPTIONID",
                            matcherValueCustomOption, Criteria.NOT_IN));
                }
                break;
            case MatchRelations.PARTIAL_MATCH:
                if (matcherValueCustomOption[0].equals(ANY_FROM_LEVEL)) {
                    return;
                } else {
                    alias = addAliasAndJoin(crit, parameterCode);
                    crit.addIn(alias + "." + "CUSTOMOPTIONID", matcherValueCustomOption);
                }
                break;
            case MatchRelations.PARTIAL_NOTMATCH:
                if (!matcherValueCustomOption[0].equals(NONE_FROM_LEVEL)) {
                    alias = addAliasAndJoin(crit, parameterCode);
                    if (criterion == null) {
                        criterion = crit.getNewCriterion(alias + "." + "CUSTOMOPTIONID",
                                matcherValueCustomOption, Criteria.NOT_IN);
                    } else {
                        criterion = criterion.or(crit.getNewCriterion(alias + "." + "CUSTOMOPTIONID",
                                matcherValueCustomOption, Criteria.NOT_IN));
                    }
                }
                break;
            }
        }
        if (criterion != null) {
            crit.add(criterion);
        }
    }
}

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

public CFAccISOCountryCurrencyBuff[] readDerivedByCountryIdx(CFAccAuthorization Authorization,
        short ISOCountryId) {
    final String S_ProcName = "CFAccRamISOCountryCurrency.readDerivedByCountryIdx() ";
    CFAccISOCountryCurrencyByCountryIdxKey key = schema.getFactoryISOCountryCurrency().newCountryIdxKey();
    key.setRequiredISOCountryId(ISOCountryId);

    CFAccISOCountryCurrencyBuff[] recArray;
    if (dictByCountryIdx.containsKey(key)) {
        SortedMap<CFAccISOCountryCurrencyPKey, CFAccISOCountryCurrencyBuff> subdictCountryIdx = dictByCountryIdx
                .get(key);/*w w  w  .j ava  2 s  . c o m*/
        recArray = new CFAccISOCountryCurrencyBuff[subdictCountryIdx.size()];
        Iterator<CFAccISOCountryCurrencyBuff> iter = subdictCountryIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAccISOCountryCurrencyBuff[0];
    }
    return (recArray);
}

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

public CFAccISOCountryLanguageBuff[] readDerivedByCountryIdx(CFAccAuthorization Authorization,
        short ISOCountryId) {
    final String S_ProcName = "CFAccRamISOCountryLanguage.readDerivedByCountryIdx() ";
    CFAccISOCountryLanguageByCountryIdxKey key = schema.getFactoryISOCountryLanguage().newCountryIdxKey();
    key.setRequiredISOCountryId(ISOCountryId);

    CFAccISOCountryLanguageBuff[] recArray;
    if (dictByCountryIdx.containsKey(key)) {
        SortedMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff> subdictCountryIdx = dictByCountryIdx
                .get(key);/* w  w  w .  j a v a 2s .c o m*/
        recArray = new CFAccISOCountryLanguageBuff[subdictCountryIdx.size()];
        Iterator<CFAccISOCountryLanguageBuff> iter = subdictCountryIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAccISOCountryLanguageBuff[0];
    }
    return (recArray);
}

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

public CFAccSubProjectBuff[] readDerivedByParentIdx(CFAccAuthorization Authorization, long TenantId,
        long ParentProjectId) {
    final String S_ProcName = "CFAccRamSubProject.readDerivedByParentIdx() ";
    CFAccSubProjectByParentIdxKey key = schema.getFactorySubProject().newParentIdxKey();
    key.setRequiredTenantId(TenantId);//from ww w .  jav a 2 s.c o m
    key.setRequiredParentProjectId(ParentProjectId);

    CFAccSubProjectBuff[] recArray;
    if (dictByParentIdx.containsKey(key)) {
        SortedMap<CFAccDomainBasePKey, CFAccSubProjectBuff> subdictParentIdx = dictByParentIdx.get(key);
        recArray = new CFAccSubProjectBuff[subdictParentIdx.size()];
        Iterator<CFAccSubProjectBuff> iter = subdictParentIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAccSubProjectBuff[0];
    }
    return (recArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamISOCountryCurrencyTable.java

public CFAstISOCountryCurrencyBuff[] readDerivedByCountryIdx(CFAstAuthorization Authorization,
        short ISOCountryId) {
    final String S_ProcName = "CFAstRamISOCountryCurrency.readDerivedByCountryIdx() ";
    CFAstISOCountryCurrencyByCountryIdxKey key = schema.getFactoryISOCountryCurrency().newCountryIdxKey();
    key.setRequiredISOCountryId(ISOCountryId);

    CFAstISOCountryCurrencyBuff[] recArray;
    if (dictByCountryIdx.containsKey(key)) {
        SortedMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff> subdictCountryIdx = dictByCountryIdx
                .get(key);//from   w w w  . j a  v  a2s .  c om
        recArray = new CFAstISOCountryCurrencyBuff[subdictCountryIdx.size()];
        Iterator<CFAstISOCountryCurrencyBuff> iter = subdictCountryIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAstISOCountryCurrencyBuff[0];
    }
    return (recArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamISOCountryLanguageTable.java

public CFAstISOCountryLanguageBuff[] readDerivedByCountryIdx(CFAstAuthorization Authorization,
        short ISOCountryId) {
    final String S_ProcName = "CFAstRamISOCountryLanguage.readDerivedByCountryIdx() ";
    CFAstISOCountryLanguageByCountryIdxKey key = schema.getFactoryISOCountryLanguage().newCountryIdxKey();
    key.setRequiredISOCountryId(ISOCountryId);

    CFAstISOCountryLanguageBuff[] recArray;
    if (dictByCountryIdx.containsKey(key)) {
        SortedMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff> subdictCountryIdx = dictByCountryIdx
                .get(key);/*www . ja  v a  2 s .  c om*/
        recArray = new CFAstISOCountryLanguageBuff[subdictCountryIdx.size()];
        Iterator<CFAstISOCountryLanguageBuff> iter = subdictCountryIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAstISOCountryLanguageBuff[0];
    }
    return (recArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamSubProjectTable.java

public CFAstSubProjectBuff[] readDerivedByParentIdx(CFAstAuthorization Authorization, long TenantId,
        long ParentProjectId) {
    final String S_ProcName = "CFAstRamSubProject.readDerivedByParentIdx() ";
    CFAstSubProjectByParentIdxKey key = schema.getFactorySubProject().newParentIdxKey();
    key.setRequiredTenantId(TenantId);//from  w w  w  .j  a  v  a 2  s .c  o m
    key.setRequiredParentProjectId(ParentProjectId);

    CFAstSubProjectBuff[] recArray;
    if (dictByParentIdx.containsKey(key)) {
        SortedMap<CFAstDomainBasePKey, CFAstSubProjectBuff> subdictParentIdx = dictByParentIdx.get(key);
        recArray = new CFAstSubProjectBuff[subdictParentIdx.size()];
        Iterator<CFAstSubProjectBuff> iter = subdictParentIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAstSubProjectBuff[0];
    }
    return (recArray);
}