rendered paste body/* * raffle.java * * Created on 1. Oktober 2006, 20:10 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package smstool;import java.util.Vector;import java.util.regex.Pattern;/** * * @author jahu.th */public class raffle implements Comparable { int _date; String _name; int _winner; int _tickets; String _link; String _image; //String[][] _winners; Vector _winners; /** Creates a new instance of raffle */ //public raffle(String date, String name, String winner, String tickets, String link, String image, String winners) { public raffle(String[] input) { System.out.println("GENERATE NEW RAFFLE!!!!"); _date = Integer.parseInt(input[0]); _name = input[1]; _winner = Integer.parseInt(input[2]); _tickets = Integer.parseInt(input[3]); _link = input[4]; _image = input[5]; _winners = new Vector(); if(input.length > 6) { String[] temp_winner = Pattern.compile("%").split(input[6]); for(int i=0; i<temp_winner.length; ++i) { String[] winnerdata = new String[]{temp_winner[i], "", "", ""}; _winners.add(winnerdata); } } } public int getDate() { return _date; } public int compareTo(Object o) throws ClassCastException { if(!(o instanceof raffle)) throw new ClassCastException("A Person object expected."); int o_date = ((raffle) o).getDate(); return this._date - o_date; } }