List of usage examples for java.util Collections EMPTY_LIST
List EMPTY_LIST
To view the source code for java.util Collections EMPTY_LIST.
Click Source Link
From source file:org.shept.persistence.provider.hibernate.HibernateExampleListProviderImpl.java
@Override public List<?> loadListFirst() { loaded = 0;//from ww w . jav a 2 s .c o m eol = false; List<?> l = Collections.EMPTY_LIST; // The criteria MUST be reloaded on loadListFirst else we would miss // changes of the underlying filter example = getFilterDefinition(); sortDef = getSortDefinition(); if (loadSize > 0) { l = getHibernateTemplate().findByExample(example, sortDef, loaded, loadSize); } else { l = getHibernateTemplate().findByExample(example, sortDef); eol = true; } incrementLoadSizeAfterFetch(l.size()); return l; }
From source file:org.apache.camel.component.http4.NoopCookieStore.java
@Override @SuppressWarnings("unchecked") public List<Cookie> getCookies() { return Collections.EMPTY_LIST; }
From source file:com.redhat.persistence.oql.MultiMap.java
List get(Object key) {
return get(key, Collections.EMPTY_LIST);
}
From source file:ar.com.zauber.commons.web.proxy.impl.ChainedURLRequestMapperTest.java
/** test */ public final void testEmpty() { final URLRequestMapper c = new ChainedURLRequestMapper(Collections.EMPTY_LIST); c.getProxiedURLFromRequest(new MockHttpServletRequest()); }
From source file:grails.plugin.searchable.internal.compass.search.DefaultSearchableSubsetHitCollector.java
/** * Collect and return the subset of hits with the range offset..offset + max * * @param hits/*from www . j av a 2s. c o m*/ * @param options * @return */ @Override public Object collect(CompassHits hits, boolean reload, Map options) { if (hits.length() == 0) { return Collections.EMPTY_LIST; } int offset = MapUtils.getIntValue(options, "offset"); int max = MapUtils.getIntValue(options, "max"); List collectedHits = new ArrayList(max); int low = offset; int high = Math.min(low + max, hits.length()); while (low < high) { collectedHits.add(getObject(hits.data(low++), reload)); } return collectedHits; }
From source file:it.unibas.spicy.utility.GenericListGenerator.java
@SuppressWarnings("unchecked") public List<List<T>> generateListsOfElements(List<List<T>> listOfLists) { if (listOfLists.isEmpty()) { return Collections.EMPTY_LIST; }/*www. j a v a 2 s.co m*/ return generate(listOfLists); }
From source file:biomine.bmvis2.pipeline.ClearOperation.java
public void doOperation(VisualGraph g) throws GraphOperationException { DefaultNodeColoring col = new DefaultNodeColoring(); Logging.debug("graph_operation", "ClearOperation.doOperation()"); for (VisualNode n : g.getAllNodes()) { n.setExtraLabels(Collections.EMPTY_LIST); n.setBaseColor(col.getFillColor(n)); }/* www. ja va 2s.co m*/ g.setHiddenEdges(Collections.EMPTY_LIST); g.setHiddenNodes(Collections.EMPTY_LIST); }
From source file:biomine.bmvis2.crawling.Databases.java
public static Collection<String> getDatabases() { if (dbs != null) return dbs; try {// www .j a va 2 s .c o m String url = WebConstants.BIOMINE_URL + "stats/index.cgi?json_action=getdbs"; String cont = URLUtils.getURLContents(new URL(url)); Object arr = JSONValue.parse(cont); if (arr instanceof JSONArray) { JSONArray jarr = (JSONArray) arr; dbs = new ArrayList(); for (Object dbo : jarr) { JSONObject jdb = (JSONObject) dbo; Object no = jdb.get("name"); if (no != null) dbs.add(no.toString()); } Collections.reverse(dbs); return dbs; } } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassCastException e) { // TODO: handle exception } return Collections.EMPTY_LIST; }
From source file:ml.shifu.shifu.util.ClassUtils.java
@SuppressWarnings("unchecked") public static List<Field> getAllFields(Class<?> clazz) { if (clazz == null || clazz.equals(Object.class)) { return Collections.EMPTY_LIST; }// ww w. java2s.c o m List<Field> result = new ArrayList<Field>(); for (Field field : clazz.getDeclaredFields()) { result.add(field); } Class<?> tmpClazz = clazz.getSuperclass(); while (!Object.class.equals(tmpClazz)) { result.addAll(getAllFields(tmpClazz)); tmpClazz = tmpClazz.getSuperclass(); } return result; }
From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.GroupsForUnit.java
@Override public Object provide(Object source, Object currentValue) { Unit unit = null;//from www .j a v a2 s . c o m try { unit = (Unit) MethodUtils.invokeMethod(source, "getUnit", null); if (unit == null) { return Collections.EMPTY_LIST; } else { return MethodUtils.invokeMethod(unit, "getGroups", null); } } catch (Exception e) { throw new RuntimeException(e); } }