1 package de.todesbaum.jsite.gui;
4 * Container for a scanned file, consisting of the name of the file and its
7 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
9 public class ScannedFile implements Comparable<ScannedFile> {
11 /** The name of the file. */
12 private final String filename;
14 /** The hash of the file. */
15 private final String hash;
18 * Creates a new scanned file.
21 * The name of the file
23 * The hash of the file
25 public ScannedFile(String filename, String hash) {
26 this.filename = filename;
35 * Returns the name of the file.
37 * @return The name of the file
39 public String getFilename() {
44 * Returns the hash of the file.
46 * @return The hash of the file
48 public String getHash() {
60 public int hashCode() {
61 return filename.hashCode();
68 public boolean equals(Object obj) {
69 return filename.equals(obj);
76 public String toString() {
88 public int compareTo(ScannedFile scannedFile) {
89 return filename.compareTo(scannedFile.filename);