| 0 | 1 package datastructures; | 
|  | 2 | 
|  | 3 public enum Format{ | 
|  | 4 	type("type"), | 
|  | 5 	sam("sam"), | 
|  | 6 	maq("maq"), | 
|  | 7 	megablast("megablast"), | 
|  | 8 	eland("eland"), | 
|  | 9 	roche("roche"), | 
|  | 10 	genome("genome"), | 
|  | 11 	target("target"), | 
|  | 12 	invalid("invalid"); | 
|  | 13 | 
|  | 14 	private String f; | 
|  | 15 | 
|  | 16 	Format(String format){ | 
|  | 17 		this.f = format; | 
|  | 18 	} | 
|  | 19 | 
|  | 20 	public Format compile(String f){ | 
|  | 21 		this.f = f; | 
|  | 22 		try{ | 
|  | 23 			return  Format.valueOf(this.f); | 
|  | 24 		}catch(IllegalArgumentException iae){ | 
|  | 25 			return invalid; | 
|  | 26 		} | 
|  | 27 	} | 
|  | 28 | 
|  | 29 	public boolean equals(Format other){ | 
|  | 30 		return this.f.equals(other.f); | 
|  | 31 	} | 
|  | 32 }; |