Click here to Skip to main content
16,018,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
private void compareSignPostInfos(final Collection<feature<? extends="" geometry="">> allSignpost,
        final Collection<feature<? extends="" geometry="">> allSignpostFromRE, final Attribute<nonspatialobject> baseSignInfo,
        NameType nameType, Attribute<nonspatialobject> name, Attribute<nonspatialobject> exitNumber,
        DictionaryRangeItem pictogram) {

        boolean matchFound = false;
        final StringBuilder destinationInfo = new StringBuilder();
        Attribute<nonspatialobject> comparedSignInfo = null;
        List<feature<? extends="" geometry="">> listOfComparedSignposts = GenericFactory.newList();
        for (final Feature currentSignpost : allSignpost) {

            final List<attribute<nonspatialobject>> compareSignInfoList = new ArrayList<>();
            if (allSignpostFromRE.contains(currentSignpost)) {
                compareSignInfoList.addAll(getSingpostInfoList(currentSignpost));

                for (final Attribute<nonspatialobject> currSignInfo : compareSignInfoList) {

                    if (isIdenticalExitNumber(exitNumber, destinationInfo, currSignInfo)
                        || isIdenticalNames(name, nameType, destinationInfo, currSignInfo)) {
                        comparedSignInfo = currSignInfo;
                        if (isAmbigous(currSignInfo)) {
                            matchFound = true;
                        }
                    } else if (isIdenticalPictogram(nameType, pictogram, destinationInfo, currSignInfo)) {
                        comparedSignInfo = currSignInfo;
                        matchFound = checkForException(compareSignInfoList, baseSignInfo, matchFound, currSignInfo);
                    }
                }
                if (!matchFound) {
                    listOfComparedSignposts.add(currentSignpost);
                } else {
                    break;
                }

            }
        }
        
        getVivaMsgAndLogViolations(baseSignInfo, exitNumber, name, nameType,matchFound, pictogram, destinationInfo,
            comparedSignInfo, listOfComparedSignposts);
       
    }


What I have tried:

I have tried creating a method. but unable to do that cause i need to return
variable comparedSignInfo and mathfound.
Posted
Updated 28-Dec-22 4:55am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900