Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://hal.archives-ouvertes.fr/hal-02404862
12 February 2020, 15:24:17 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • 759bd8995e51c4e40aa72fd5657d5e6e04c6da89
    No releases to show
  • 1cff1f7
  • /
  • src
  • /
  • comparators
  • /
  • MapIdMessagesSujetComparator.java
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:e3358834aeb079897d8c9cc7fe901806eb8c0d82
origin badgedirectory badge Iframe embedding
swh:1:dir:00105bb6c193575486250f41556bcf974d2a7ef2
origin badgerevision badge
swh:1:rev:759bd8995e51c4e40aa72fd5657d5e6e04c6da89
origin badgesnapshot badge
swh:1:snp:74caa082caa84915ddb3c6c14e6a08a121a2415f

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 759bd8995e51c4e40aa72fd5657d5e6e04c6da89 authored by Software Heritage on 04 February 2020, 13:44:27 UTC
hal: Deposit 405 in collection hal
Tip revision: 759bd89
MapIdMessagesSujetComparator.java
package comparators;

import java.util.Comparator;
import java.util.Map;

import modeles.MessageModel;

public class MapIdMessagesSujetComparator implements Comparator<Object> {

	private Map<String, MessageModel> map;
	private boolean ascendant;

	public MapIdMessagesSujetComparator(Map<String, MessageModel> map, boolean ascendant) {
		this.map = map;
		this.ascendant = ascendant;
	}

	@Override
	public int compare(Object a, Object b) {
		String expA = map.get(a).getSujet();
		String expB = map.get(b).getSujet();
		if (expA.equals(expB))
			return -1;
		else {
			if (ascendant)
				return expA.compareToIgnoreCase(expB);
			else
				return expB.compareToIgnoreCase(expA);

		}
	}
}

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API