com.atlassian.jira.issue.attachment
Class AttachmentFileNameComparator

java.lang.Object
  extended by com.atlassian.jira.issue.attachment.AttachmentFileNameComparator
All Implemented Interfaces:
Comparator<Attachment>

public class AttachmentFileNameComparator
extends Object
implements Comparator<Attachment>

Compares attachments based on the file's name.

The comparison is handled using a Collator}, so that the results are locale-aware.

Since:
v4.2
See Also:
Collator

Constructor Summary
AttachmentFileNameComparator(Locale userLocale)
          Creates a new instance of this comparator with the provided locale
 
Method Summary
 int compare(Attachment a1, Attachment a2)
           
 
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
 

Constructor Detail

AttachmentFileNameComparator

public AttachmentFileNameComparator(Locale userLocale)
Creates a new instance of this comparator with the provided locale

Parameters:
userLocale - The locale to be used to determine order of the file names.
Method Detail

compare

public int compare(Attachment a1,
                   Attachment a2)
Specified by:
compare in interface Comparator<Attachment>


Copyright © 2002-2012 Atlassian. All Rights Reserved.