List of utility methods to do List First Item
boolean | hasSameElement(List has Same Element for (Integer element : firstList) { if (secondList.contains(element)) { return true; return false; |
boolean | isFirst(List is First V first = getFirst(list);
return first.equals(object);
|
boolean | isFirstAnnotationOfMethod(List is First Annotation Of Method String line = lines.get(lineNumber); if (isAnnotation(line) && (lineNumber == 0 || !isAnnotation(lines, lineNumber - 1))) { int i = lineNumber + 1; while (i < lines.size() && isAnnotation(lines.get(i))) { i++; return isMethodDeclaration(lines, i); return false; |
boolean | isFirstPage(List
is First Page return rawPages.indexOf(pageLines) == 0;
|
boolean | isInOrder(List> src, Object first, Object second) is In Order int firstIndex = src.indexOf(first); int secondIndex = src.indexOf(second); return firstIndex < secondIndex; |
List | limit(List limit return limit(list, firstResult != null ? firstResult.intValue() : null,
maxResults != null ? maxResults.intValue() : null);
|
List | listWith(Object aFirstObject) list With List list = new ArrayList(); list.add(aFirstObject); return list; |
List | merge(List merge ArrayList<String> result = new ArrayList<String>(first); result.addAll(second); return result; |
List | mergeLists(List first, List second) Merge two lists into a single list if (first == null) return second; else if (second == null) return first; else { first.addAll(second); return first; |
List | mergeLists(List merge Lists List<E> merged = new ArrayList<E>(first); for (E obj : second) { if (!merged.contains(obj)) merged.add(obj); return merged; |