
/* 0123456789012345678901234567890123456789012345678901234567890123456789789 */

/*
 * edc_file.java
 *
 * This file is part of cd_create.
 *
 * cd_create is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * cd_create is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with cd_create; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Copyright 2004 Abi Arroyo
 */
 
 public class edc_file implements Comparable {
 	
 	long size;
 	String name;
 	
 	public edc_file (String filename, long length) {
 		this.name = filename;
 		this.size = length;
 	}
 	
 	public long getSize () {
 		return size;
 	}
 	
 	public String getName () {
 		return name;
 	}

 	public int compareTo (Object o) {
 		edc_file f = (edc_file) o;
 		
 		if (this.size == f.getSize()) {
 			return 0;
 		}
 		if (this.size < f.getSize()) {
 			return -1;
 		}
 		else {
 			return 1;
 		}
 	}
 	
 	public String toString() {
 		return (size + " " + name);
 	}
 }