-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into bugfix/intermittently_failing_tests
- Loading branch information
Showing
8 changed files
with
71 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/src/main/java/uk/ac/ebi/atlas/experimentpage/markergenes/ClusterNameComparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package uk.ac.ebi.atlas.experimentpage.markergenes; | ||
|
||
import java.text.Collator; | ||
import java.util.Comparator; | ||
import java.util.Locale; | ||
|
||
class ClusterNameComparator implements Comparator<String> { | ||
|
||
@Override | ||
public int compare(String o1, String o2) { | ||
final String regexForNumeric = "^[0-9]*$"; | ||
|
||
if (o1.matches(regexForNumeric) && o2.matches(regexForNumeric)) { | ||
return Integer.compare(Integer.parseInt(o1), Integer.parseInt(o2)); | ||
} else if (o1.matches(regexForNumeric)) { | ||
return 1; | ||
} else if (o2.matches(regexForNumeric)) { | ||
return -1; | ||
} else { | ||
return Collator.getInstance(Locale.US).compare(o1, o2); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
...ac/ebi/atlas/experimentpage/markergenes/MarkerGeneComparatorByCellGroupValueByMarker.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...ebi/atlas/experimentpage/markergenes/MarkerGeneComparatorByCellGroupValueWhereMarker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package uk.ac.ebi.atlas.experimentpage.markergenes; | ||
|
||
import java.util.Comparator; | ||
|
||
class MarkerGeneComparatorByCellGroupValueWhereMarker implements Comparator<MarkerGene> { | ||
|
||
public int compare(MarkerGene marker1, MarkerGene marker2) { | ||
var clusterNameComparator = new ClusterNameComparator(); | ||
|
||
return clusterNameComparator.compare( | ||
marker1.cellGroupValueWhereMarker(),marker2.cellGroupValueWhereMarker()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters