Package: VdmCompletionProposalSorter

VdmCompletionProposalSorter

nameinstructionbranchcomplexitylinemethod
VdmCompletionProposalSorter()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
compare(ICompletionProposal, ICompletionProposal)
M: 22 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.overture.ide.ui.templates;
2:
3: import org.eclipse.jface.text.contentassist.ICompletionProposal;
4: import org.eclipse.jface.text.contentassist.ICompletionProposalSorter;
5:
6: public class VdmCompletionProposalSorter implements ICompletionProposalSorter {
7:
8:         @Override
9:         public int compare(ICompletionProposal arg0, ICompletionProposal arg1) {
10:                 String functionName1 = arg0.getDisplayString().toUpperCase();
11:                 String functionName2 = arg1.getDisplayString().toUpperCase();
12:                 functionName1 = functionName1.replaceAll("[^a-zA-Z0-9]", "");
13:                 functionName2 = functionName2.replaceAll("[^a-zA-Z0-9]", "");
14:                  //ascending order
15:                 return functionName1.compareTo(functionName2);
16:                 
17:         }
18:
19: }