private Integer getStart() { final SimpleSuperMatch firstMatch = superMatchList.iterator().next(); if (firstMatch != null) { final SimpleLocation location = firstMatch.getLocation(); if (location != null) { return location.getStart(); } } return null; }
/** * Tests to see if any of the matches that are tied together overlap with matches already on the * line. If there is no overlap, then the supermatches are added to the line. * * @param superMatchBucket * @return */ public boolean addSuperMatchesSameTypeWithoutOverlap(final SuperMatchBucket superMatchBucket) { if (!this.type.equals(superMatchBucket.getType())) { return false; } for (SimpleSuperMatch candidate : superMatchBucket.getSupermatches()) { for (SimpleSuperMatch existingMatch : superMatchList) { if (candidate.matchesOverlap(existingMatch, true)) { return false; } } } superMatchList.addAll(superMatchBucket.getSupermatches()); return true; }