List of usage examples for java.util SortedMap size
int size();
From source file:hudson.plugins.jobConfigHistory.FileHistoryDaoTest.java
/** * Test of getJobHistory method, of class FileHistoryDao. *///from w w w . jav a 2 s.c o m @Test public void testGetJobHistory() { final SortedMap<String, HistoryDescr> result = sutWithUserAndNoDuplicateHistory.getJobHistory("Test1"); assertEquals(5, result.size()); assertEquals("2012-11-21_11-29-12", result.firstKey()); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamAccountTable.java
public CFAccAccountBuff[] readDerivedByCcyIdx(CFAccAuthorization Authorization, short CurrencyId) { final String S_ProcName = "CFAccRamAccount.readDerivedByCcyIdx() "; CFAccAccountByCcyIdxKey key = schema.getFactoryAccount().newCcyIdxKey(); key.setRequiredCurrencyId(CurrencyId); CFAccAccountBuff[] recArray;//from ww w. j a va 2 s . c o m if (dictByCcyIdx.containsKey(key)) { SortedMap<CFAccAccountPKey, CFAccAccountBuff> subdictCcyIdx = dictByCcyIdx.get(key); recArray = new CFAccAccountBuff[subdictCcyIdx.size()]; Iterator<CFAccAccountBuff> iter = subdictCcyIdx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new CFAccAccountBuff[0]; } return (recArray); }
From source file:edu.umd.cfar.lamp.viper.util.Range.java
/** * @see java.util.Set#equals(java.lang.Object) *//*from ww w .j a v a2 s. c om*/ public boolean equals(Object o) { if (this == o) { return true; } else if (o instanceof Range) { SortedMap oSpans = ((Range) o).spans; if (oSpans.size() != spans.size()) { return false; } else { Iterator myIter = spans.entrySet().iterator(); Iterator oIter = oSpans.entrySet().iterator(); while (myIter.hasNext()) { if (!myIter.next().equals(oIter.next())) { return false; } } return true; } } else { return false; } }
From source file:hudson.plugins.jobConfigHistory.FileHistoryDaoTest.java
/** * Test of getSystemHistory method, of class FileHistoryDao. *//*from w w w . j a va2s.c om*/ @Test public void testGetSystemHistory() { final SortedMap<String, HistoryDescr> result = sutWithUserAndNoDuplicateHistory.getSystemHistory("config"); assertEquals(5, result.size()); assertEquals("2013-01-18_17-34-22", result.firstKey()); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgClient.CFAccXMsgClientSecGroupFormTable.java
public CFAccSecGroupFormBuff[] readAllDerived(CFAccAuthorization Authorization) { final String S_ProcName = "readAllDerived"; String rqst = CFAccXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFAccXMsgSecGroupFormMessageFormatter.formatSecGroupFormRqstReadAll("\n\t\t\t") + "\n" + CFAccXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); }//ww w. jav a 2 s.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<CFAccSecGroupFormPKey, ICFAccSecGroupFormObj> sortedMap = (SortedMap<CFAccSecGroupFormPKey, ICFAccSecGroupFormObj>) sortedMapObj; int sz = sortedMap.size(); CFAccSecGroupFormBuff arr[] = new CFAccSecGroupFormBuff[sz]; Iterator<ICFAccSecGroupFormObj> iter = sortedMap.values().iterator(); ICFAccSecGroupFormObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFAccSecGroupFormObj) iter.next(); arr[idx] = cur.getSecGroupFormBuff(); } return (arr); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstXMsgClient.CFAstXMsgClientSecGroupFormTable.java
public CFAstSecGroupFormBuff[] readAllDerived(CFAstAuthorization Authorization) { final String S_ProcName = "readAllDerived"; String rqst = CFAstXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFAstXMsgSecGroupFormMessageFormatter.formatSecGroupFormRqstReadAll("\n\t\t\t") + "\n" + CFAstXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); }/*from www. j a va2s. co m*/ CFAstXMsgRspnHandler 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<CFAstSecGroupFormPKey, ICFAstSecGroupFormObj> sortedMap = (SortedMap<CFAstSecGroupFormPKey, ICFAstSecGroupFormObj>) sortedMapObj; int sz = sortedMap.size(); CFAstSecGroupFormBuff arr[] = new CFAstSecGroupFormBuff[sz]; Iterator<ICFAstSecGroupFormObj> iter = sortedMap.values().iterator(); ICFAstSecGroupFormObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFAstSecGroupFormObj) iter.next(); arr[idx] = cur.getSecGroupFormBuff(); } return (arr); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgClient.CFAccXMsgClientSecGroupFormTable.java
public CFAccSecGroupFormBuff[] readDerivedByClusterIdx(CFAccAuthorization Authorization, long argClusterId) { final String S_ProcName = "readDerivedByClusterIdx"; String rqst = CFAccXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFAccXMsgSecGroupFormMessageFormatter.formatSecGroupFormRqstReadByClusterIdx("\n\t\t\t", argClusterId)//from ww w . ja v a 2s.c om + "\n" + CFAccXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } 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<CFAccSecGroupFormPKey, ICFAccSecGroupFormObj> sortedMap = (SortedMap<CFAccSecGroupFormPKey, ICFAccSecGroupFormObj>) sortedMapObj; int sz = sortedMap.size(); CFAccSecGroupFormBuff arr[] = new CFAccSecGroupFormBuff[sz]; Iterator<ICFAccSecGroupFormObj> iter = sortedMap.values().iterator(); ICFAccSecGroupFormObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFAccSecGroupFormObj) iter.next(); arr[idx] = cur.getSecGroupFormBuff(); } return (arr); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstXMsgClient.CFAstXMsgClientSecGroupFormTable.java
public CFAstSecGroupFormBuff[] readDerivedByClusterIdx(CFAstAuthorization Authorization, long argClusterId) { final String S_ProcName = "readDerivedByClusterIdx"; String rqst = CFAstXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFAstXMsgSecGroupFormMessageFormatter.formatSecGroupFormRqstReadByClusterIdx("\n\t\t\t", argClusterId)// www . j av a 2s .co m + "\n" + CFAstXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFAstXMsgRspnHandler 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<CFAstSecGroupFormPKey, ICFAstSecGroupFormObj> sortedMap = (SortedMap<CFAstSecGroupFormPKey, ICFAstSecGroupFormObj>) sortedMapObj; int sz = sortedMap.size(); CFAstSecGroupFormBuff arr[] = new CFAstSecGroupFormBuff[sz]; Iterator<ICFAstSecGroupFormObj> iter = sortedMap.values().iterator(); ICFAstSecGroupFormObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFAstSecGroupFormObj) iter.next(); arr[idx] = cur.getSecGroupFormBuff(); } return (arr); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamAccountTable.java
public CFAccAccountBuff[] readDerivedByTenantIdx(CFAccAuthorization Authorization, long TenantId) { final String S_ProcName = "CFAccRamAccount.readDerivedByTenantIdx() "; CFAccAccountByTenantIdxKey key = schema.getFactoryAccount().newTenantIdxKey(); key.setRequiredTenantId(TenantId);//w w w . ja v a 2s .c o m CFAccAccountBuff[] recArray; if (dictByTenantIdx.containsKey(key)) { SortedMap<CFAccAccountPKey, CFAccAccountBuff> subdictTenantIdx = dictByTenantIdx.get(key); recArray = new CFAccAccountBuff[subdictTenantIdx.size()]; Iterator<CFAccAccountBuff> iter = subdictTenantIdx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new CFAccAccountBuff[0]; } return (recArray); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgClient.CFAccXMsgClientSecGroupFormTable.java
public CFAccSecGroupFormBuff[] readDerivedByGroupIdx(CFAccAuthorization Authorization, long argClusterId, int argSecGroupId) { final String S_ProcName = "readDerivedByGroupIdx"; String rqst = CFAccXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFAccXMsgSecGroupFormMessageFormatter.formatSecGroupFormRqstReadByGroupIdx("\n\t\t\t", argClusterId, argSecGroupId) + "\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. ja v a 2 s . 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<CFAccSecGroupFormPKey, ICFAccSecGroupFormObj> sortedMap = (SortedMap<CFAccSecGroupFormPKey, ICFAccSecGroupFormObj>) sortedMapObj; int sz = sortedMap.size(); CFAccSecGroupFormBuff arr[] = new CFAccSecGroupFormBuff[sz]; Iterator<ICFAccSecGroupFormObj> iter = sortedMap.values().iterator(); ICFAccSecGroupFormObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFAccSecGroupFormObj) iter.next(); arr[idx] = cur.getSecGroupFormBuff(); } return (arr); }