List of utility methods to do List Compare
boolean | compareTwoListOfStrings(List compare Two List Of Strings boolean result = false; int contCompare = 0; for (int i = 0; i < first.size(); i++) { String data = first.get(i); if (data.equals(second.get(i))) { contCompare++; if (contCompare == first.size()) { result = true; return result; |
void | compareVectors(List compare Vectors final int rowsA = vectorA.size(); final int rowsB = vectorB.size(); if (rowsA != rowsB) { throw new RuntimeException( String.format("vector A dimension (%d) differs from dimension of vector B (%d)", rowsA, rowsB)); for (int y = 0; y < vectorA.size(); y++) { double valA = vectorA.get(y); ... |
boolean | equalsToAny(Object comparable, Object... compareList) equals To Any return Arrays.asList(compareList).contains(comparable);
|
List | parseAndCompare(List This method take a list of fileName of the type partitionId_Replica_Chunk and returns file names that match the regular expression masterPartitionId_ List<String> sourceFileNames = new ArrayList<String>(); for (String fileName : fileNames) { String[] partitionIdReplicaChunk = fileName.split(SPLIT_LITERAL); if (Integer.parseInt(partitionIdReplicaChunk[0]) == masterPartitionId) { sourceFileNames.add(fileName); return sourceFileNames; ... |
void | sortList(List sort List if (isEmpty(sources) || comparer == null) { return; Collections.sort(sources, comparer); |