Java Code Examples for java.util.AbstractCollection#isEmpty()
The following examples show how to use
java.util.AbstractCollection#isEmpty() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Client.java From JFX-Browser with MIT License | 5 votes |
private static String join(AbstractCollection<String> col, String delimiter) { if (col.isEmpty()) return ""; Iterator<String> iter = col.iterator(); StringBuffer buffer = new StringBuffer(iter.next()); while(iter.hasNext()) buffer.append(delimiter).append(iter.next()); return buffer.toString(); }
Example 2
Source File: IterableAdapter.java From springlets with Apache License 2.0 | 5 votes |
@Override public Iterable<S> unmarshal(AbstractCollection<S> source) throws Exception { if (source == null || source.isEmpty()) { return Collections.emptyList(); } return source; }
Example 3
Source File: StringUtils.java From spork with Apache License 2.0 | 5 votes |
public static String join(AbstractCollection<String> s, String delimiter) { if (s.isEmpty()) return ""; Iterator<String> iter = s.iterator(); StringBuffer buffer = new StringBuffer(iter.next()); while (iter.hasNext()) { buffer.append(delimiter); buffer.append(iter.next()); } return buffer.toString(); }
Example 4
Source File: LoadFunc.java From spork with Apache License 2.0 | 5 votes |
/** * Join multiple strings into a string delimited by the given delimiter. * * @param s a collection of strings * @param delimiter the delimiter * @return a 'delimiter' separated string */ public static String join(AbstractCollection<String> s, String delimiter) { if (s.isEmpty()) return ""; Iterator<String> iter = s.iterator(); StringBuffer buffer = new StringBuffer(iter.next()); while (iter.hasNext()) { buffer.append(delimiter); buffer.append(iter.next()); } return buffer.toString(); }
Example 5
Source File: StringManipulationHelper.java From biojava with GNU Lesser General Public License v2.1 | 5 votes |
public static String join(AbstractCollection<String> s, String delimiter) { if (s == null || s.isEmpty()) return ""; Iterator<String> iter = s.iterator(); StringBuilder builder = new StringBuilder(iter.next()); while( iter.hasNext() ) { builder.append(delimiter).append(iter.next()); } return builder.toString(); }