} else if (line.matches(SEGMENT_GROUP_END)) {
Matcher matcher = Pattern.compile(SEGMENT_GROUP_END).matcher(line);
matcher.matches();
String id = getLineId(lineNo, matcher.group(1));
Segment segment = createSegment(id, matcher.group(2), matcher.group(3), matcher.group(4), matcher.group(5), definitions, isSplitIntoImport, useShortName, segmentDefinitions);
parentGroup.getSegments().add(segment);
return extractPlusCharacter(matcher.group(6)).length() - 1;
} else if (line.matches(SEGMENT_REGULAR)) {
Matcher matcher = Pattern.compile(SEGMENT_REGULAR).matcher(line);
matcher.matches();
String id = getLineId(lineNo, matcher.group(1));
if (!ignoreSegments.contains(matcher.group(2))) {
Segment segment = createSegment(id, matcher.group(2), matcher.group(3), matcher.group(4), matcher.group(5), definitions, isSplitIntoImport, useShortName, segmentDefinitions);
parentGroup.getSegments().add(segment);
}
} else if (!line.trim().equals("") && line.matches(SEGMENT_REGULAR_START)) {
Matcher matcher = Pattern.compile(SEGMENT_REGULAR_START).matcher(line);
matcher.matches();
String id = getLineId(lineNo, matcher.group(1));
String segcode = matcher.group(2);
String description = matcher.group(3);
line = reader.readLine();
matcher = Pattern.compile(SEGMENT_REGULAR_END).matcher(line);
matcher.matches();
description += " " + matcher.group(1);
if (!ignoreSegments.contains(matcher.group(2))) {
Segment segment = createSegment(id, segcode, description, matcher.group(2), matcher.group(3), definitions, isSplitIntoImport, useShortName, segmentDefinitions);
parentGroup.getSegments().add(segment);
}
} else if (line.matches(ANNEX)) {
return 0;
}