List of usage examples for java.util Collections EMPTY_SET
Set EMPTY_SET
To view the source code for java.util Collections EMPTY_SET.
Click Source Link
From source file:org.mskcc.cbio.importer.dao.internal.ImportDataRecordHibernateDAO.java
/** * Functon to retrieve ImportDataRecord via tumor type, data type, and center. * * @param tumorType String/*from w w w .java 2 s .c o m*/ * @param dataType String * @param center String * @param runDate String * @return ImportDataRecord */ @Override @Transactional(propagation = Propagation.REQUIRED) public Collection<ImportDataRecord> getImportDataRecordByTumorTypeAndDatatypeAndCenterAndRunDate( String tumorType, String datatype, String center, String runDate) { Session session = getSession(); Query query = session.getNamedQuery( "org.mskcc.cbio.import.model.importDataRecordByTumorTypeAndDatatypeAndCenterAndRunDate"); query.setParameter("tumortype", tumorType); query.setParameter("datatype", datatype); query.setParameter("center", center); query.setParameter("rundate", runDate); List<ImportDataRecord> toReturn = query.list(); return (toReturn.size() > 0) ? new ArrayList<ImportDataRecord>(toReturn) : Collections.EMPTY_SET; }
From source file:org.vosao.search.impl.SearchIndexImpl.java
private Set<Long> getPageIds(String query) { String[] words = StrUtil.splitByWord(query); if (words.length == 0) { return Collections.EMPTY_SET; }/*from w ww . j a va2 s. co m*/ Set<Long> keys = getPageKeys(words[0]); int i = 0; for (String word : words) { if (i++ > 0) { keys = keysLogicalAnd(keys, getPageKeys(word)); } } //logger.info("found keys " + keys.toString()); return keys; }
From source file:org.jactr.modules.pm.aural.audicon.map.LocationFeatureMap.java
protected Collection<IIdentifier> equal(IChunk when) { Set<IIdentifier> identifiers = _locationMap.get(when); if (identifiers == null) identifiers = Collections.EMPTY_SET; return identifiers; }
From source file:org.stockwatcher.web.WatchListController.java
@RequestMapping(value = "/addtowatchlist", method = RequestMethod.POST) public String addToWatchList(Model model, HttpServletRequest request) { String id = getRequestParameter(request, "watchListId"); String stockSymbol = getRequestParameter(request, "stockSymbol"); User user = (User) request.getSession().getAttribute("user"); UUID watchListId = null;// w w w. j a v a2 s . c om WatchList watchList = null; if (CREATE_NEW.equals(id)) { String displayName = getRequestParameter(request, "displayName"); watchList = new WatchList(); watchList.setDisplayName(displayName); watchList.setUserId(user.getId()); watchListDAO.insertWatchList(watchList); watchListId = watchList.getId(); LOGGER.info("Created watchList {}", watchListId); } else { watchListId = UUID.fromString(id); watchList = watchListDAO.getWatchList(watchListId); } // Make sure the user owns the watch list if (watchList.getUserId().equals(user.getId())) { watchListDAO.addWatchListStock(watchListId, stockSymbol); LOGGER.info("Added symbol {} to watchList {}", stockSymbol, watchListId); } else { LOGGER.warn("Unable to add symbol {} to watchList {}", stockSymbol, watchListId); } model.addAttribute("watchLists", user == null ? Collections.EMPTY_SET : watchListDAO.getWatchListsByUserId(user.getId())); return "watchListOptions"; }
From source file:org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy.java
@SuppressWarnings("unchecked") public ProportionalCapacityPreemptionPolicy() { clock = new SystemClock(); allPartitions = Collections.EMPTY_SET; leafQueueNames = Collections.EMPTY_SET; preemptableQueues = Collections.EMPTY_MAP; }
From source file:com.github.p4535992.database.datasource.database.data.Dao.java
@SuppressWarnings("unchecked") public void delete(Map<String, Object> rowData) { final Set<Entry<String, Object>> keys = extractPrimaryKeyValues(rowData); final String delete = createDeleteScript(keys); execute(Collections.EMPTY_SET, keys, delete); }
From source file:hr.fer.spocc.grammar.Grammar.java
@SuppressWarnings("unchecked") protected Set<ProductionRule<T>> getProductionsRightSymbol(Symbol<T> symbol) { if (!this.rightSideSymbolMap.containsKey(symbol)) return Collections.EMPTY_SET; return this.rightSideSymbolMap.getAll(symbol); }
From source file:org.capelin.mvc.utils.LuceneBuilder.java
protected Analyzer getAnalyzer(boolean isKeyword) { if (isKeyword) { return new StandardAnalyzer(Version.LUCENE_30, Collections.EMPTY_SET); //return new SimpleAnalyzer(); }//from w w w. j a v a 2s .c om return new StandardAnalyzer(Version.LUCENE_30); }
From source file:org.apache.sling.osgi.obr.Repository.java
public Iterator getResourcesByCategory(String categoryName) { this.ensureLoaded(); Set resources = (Set) this.resourcesByCategory.get(categoryName); if (resources != null) { return resources.iterator(); }// w w w .j av a 2 s .c om return Collections.EMPTY_SET.iterator(); }
From source file:org.apache.camel.impl.DefaultPackageScanClassResolver.java
@SuppressWarnings("unchecked") public Set<Class<?>> findImplementations(Class parent, String... packageNames) { if (packageNames == null) { return Collections.EMPTY_SET; }// w w w .ja v a 2 s . c om if (log.isDebugEnabled()) { log.debug("Searching for implementations of " + parent.getName() + " in packages: " + Arrays.asList(packageNames)); } PackageScanFilter test = getCompositeFilter(new AssignableToPackageScanFilter(parent)); Set<Class<?>> classes = new LinkedHashSet<Class<?>>(); for (String pkg : packageNames) { find(test, pkg, classes); } if (log.isDebugEnabled()) { log.debug("Found: " + classes); } return classes; }