Package org.dspace.app.util
Class GoogleBitstreamComparator
- java.lang.Object
-
- org.dspace.app.util.GoogleBitstreamComparator
-
- All Implemented Interfaces:
Comparator<Bitstream>
public class GoogleBitstreamComparator extends Object implements Comparator<Bitstream>
This comparator is used to order files of an item, so that they are ordered in a way that the first one is the most useful for use in the citation_pdf_url for Google Scholar
-
-
Constructor Summary
Constructors Constructor Description GoogleBitstreamComparator(Context context, Map<String,String> googleScholarSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Bitstream b1, Bitstream b2)Compares two bitstreams based on their mimetypes, if mimetypes are the same,then the largest bitstream comes first See google-metadata.properties to define the order-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(Bitstream b1, Bitstream b2)
Compares two bitstreams based on their mimetypes, if mimetypes are the same,then the largest bitstream comes first See google-metadata.properties to define the order- Specified by:
comparein interfaceComparator<Bitstream>- Parameters:
b1- first bitstreamb2- second bitstream- Returns:
-
-