1 16 package org.apache.commons.vfs.provider; 17 18 import org.apache.commons.vfs.FileSystemOptions; 19 20 25 class FileSystemKey implements Comparable 26 { 27 private final static FileSystemOptions EMPTY_OPTIONS = new FileSystemOptions(); 28 29 final Comparable key; 30 final FileSystemOptions fileSystemOptions; 31 32 FileSystemKey(final Comparable key, final FileSystemOptions fileSystemOptions) 33 { 34 this.key = key; 35 if (fileSystemOptions != null) 36 { 37 this.fileSystemOptions = fileSystemOptions; 38 } 39 else 40 { 41 this.fileSystemOptions = EMPTY_OPTIONS; 42 } 43 } 44 45 public int compareTo(Object o) 46 { 47 FileSystemKey fk = (FileSystemKey) o; 48 49 int ret = key.compareTo(fk.key); 50 if (ret != 0) 51 { 52 return ret; 54 } 55 56 return fileSystemOptions.compareTo(fk.fileSystemOptions); 57 } 58 } | Popular Tags |