private ITextUnit getSource(List<ITextUnit> cells, int colNum, List<Integer> columnsList, List<Integer> refList) { if (columnsList == null) return null; int index = columnsList.indexOf(colNum); if (!Util.checkIndex(index, refList)) return null; int ref = refList.get(index) - 1; // refList items are 1-based if (!Util.checkIndex(ref, cells)) return null; return cells.get(ref); }
private String getSuffix(int colNum) { if (sourceColumns == null) return ""; int index = sourceColumns.indexOf(colNum); if (!Util.checkIndex(index, sourceIdSuffixes)) return ""; return sourceIdSuffixes.get(index); }
private String getSuffixFromSourceRef(int colNum) { if (sourceIdColumns == null) return ""; int index = sourceIdColumns.indexOf(colNum); if (!Util.checkIndex(index, sourceIdSuffixes)) return ""; return sourceIdSuffixes.get(index); }
if (!Util.checkIndex(start, array) && !Util.checkIndex(end, array)) return ""; if (start < 0 && Util.checkIndex(end, array)) start = 0; if (Util.checkIndex(start, array) && end >= array.length) end = array.length - 1;
public static GenericSkeletonPart getPart(GenericSkeleton skel, int index) { List<GenericSkeletonPart> parts = skel.getParts(); if (!Util.checkIndex(index, parts)) return null; return parts.get(index); }
private LocaleId getLanguageFromTargetRef(int colNum) { if ( targetColumns == null ) return LocaleId.EMPTY; int index = targetColumns.indexOf(colNum); if ( !Util.checkIndex(index, targetLanguages) ) return getTargetLocale(); return targetLanguages.get(index); }
if (Util.checkIndex(start, list) && Util.checkIndex(end, list)) res.addAll(list.subList(start, end + 1));
/** * Replaces a part of a given skeleton with another given skeleton part. * @param skel the skeleton which part is being replaced. * @param index the index of the skeleton part to be replaced. * @param replacement the given new skeleton part to replace the existing one. * @return true if replacement succeeded. */ public static boolean replaceSkeletonPart (GenericSkeleton skel, int index, GenericSkeleton replacement) { if ( skel == null ) return false; if ( replacement == null ) return false; List<GenericSkeletonPart> list = skel.getParts(); if ( !Util.checkIndex(index, list) ) return false; List<GenericSkeletonPart> list2 = (List<GenericSkeletonPart>) ListUtil.moveItems(list); // clears the original list for (int i = 0; i < list2.size(); i++) { if ( i == index ) skel.add(replacement); else list.add(list2.get(i)); } return true; }
if (Util.checkIndex(index + 1, buf)) buf.remove(index + 1); // Line num if (!Util.checkIndex(index - 1, buf)) break; if (!Util.checkIndex(index + 1, buf)) break; if (index >= start && start > -1) return; if (!Util.checkIndex(index, buffer)) return; // = -1, no complete line of chunks if (!Util.checkIndex(index + 1, buffer)) return; // No line num item long lineNum = new Long(buffer.get(index + 1));
int index = params.recordIdColumn - 1; if (Util.checkIndex(index, cells)) recordID = TextUnitUtil.getSourceText(cells.get(index));