List of usage examples for java.util Collection add
boolean add(E e);
From source file:Main.java
private static void _addSuperTypes(Class<?> cls, Class<?> endBefore, Collection<Class<?>> result, boolean addClassItself) { if (cls == endBefore || cls == null || cls == Object.class) { return;//from ww w . j av a 2 s .co m } if (addClassItself) { if (result.contains(cls)) { // already added, no need to check supers return; } result.add(cls); } for (Class<?> intCls : cls.getInterfaces()) { _addSuperTypes(intCls, endBefore, result, true); } _addSuperTypes(cls.getSuperclass(), endBefore, result, true); }
From source file:Main.java
public static boolean addAll(final Collection<? super Byte> c, final byte... array) { boolean result = false; for (final byte element : array) { result |= c.add(element); }/*from www. j av a 2 s. co m*/ return result; }
From source file:Main.java
public static boolean addAll(final Collection<? super Long> c, final long... array) { boolean result = false; for (final long element : array) { result |= c.add(element); }/*from ww w.j av a 2s . co m*/ return result; }
From source file:net.mlw.vlh.web.util.JspUtils.java
/** * Converts a stirng into a collection of strings. * //from ww w.jav a 2 s. com * @param value * The string to be parsed. * @param token * The token to be used. * @return A Collection of String(s). */ public static Collection toCollection(String value, String token) { if (value == null || value.length() == 0) { return Collections.EMPTY_LIST; } Collection elements = new ArrayList(); for (StringTokenizer st = new StringTokenizer(value, token); st.hasMoreElements();) { elements.add(st.nextToken()); } return elements; }
From source file:Main.java
public static boolean addAll(final Collection<? super Integer> c, final int... array) { boolean result = false; for (final int element : array) { result |= c.add(element); }/* w w w . j av a2 s. com*/ return result; }
From source file:Main.java
private static void innerListFiles(Collection<File> files, File directory, FileFilter filter) { File[] found = directory.listFiles(filter); if (found != null) for (File file : found) if (file.isDirectory()) innerListFiles(files, file, filter); else/*from w ww . j a va 2 s . co m*/ files.add(file); }
From source file:disko.ParagraphDetector.java
public static void detectParagraphs(String s, Collection<Ann> annotations) { Matcher m = paragraphSplitter.matcher(s); int start = 0; while (m.find()) { int end = m.start(); String found = s.subSequence(start, end).toString(); ParagraphAnn ann = new ParagraphAnn(start, end, found); annotations.add(ann); log.debug("Found ParagraphAnn " + ann); start = m.end();// www . j a v a2 s . c o m } if (annotations.isEmpty() && s.trim().length() > 0) annotations.add(new ParagraphAnn(0, s.length(), s)); }
From source file:Main.java
public static boolean addAll(final Collection<? super Short> c, final short... array) { boolean result = false; for (final short element : array) { result |= c.add(element); }//from w w w. j a va 2 s . co m return result; }
From source file:Main.java
public static boolean addAll(final Collection<? super Float> c, final float... array) { boolean result = false; for (final float element : array) { result |= c.add(element); }//from w w w.ja v a 2 s . co m return result; }
From source file:Main.java
public static boolean addAll(final Collection<? super Character> c, final char... array) { boolean result = false; for (final char element : array) { result |= c.add(element); }//from w ww .ja va 2 s .c o m return result; }