com.atlassian.jira.issue.attachment
Class AttachmentFileNameCreationDateComparator

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

public class AttachmentFileNameCreationDateComparator
extends java.lang.Object
implements java.util.Comparator<Attachment>

Compares attachments by file name first, and then creation date if the file names are the same.

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

Since:
v4.2
See Also:
Collator

Constructor Summary
AttachmentFileNameCreationDateComparator(java.util.Locale userLocale)
          Creates a new instance of this attachment comparator.
 
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

AttachmentFileNameCreationDateComparator

public AttachmentFileNameCreationDateComparator(java.util.Locale userLocale)
Creates a new instance of this attachment comparator.

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 java.util.Comparator<Attachment>


Copyright © 2002-2010 Atlassian. All Rights Reserved.