package com.wxpn.tutorial.servlet;

import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;

public class Question {
	private int id;

	private String title;

	private String style;

	private int votecount;

	private Date startime;

	private String strStartime;

	private Date endtime;

	private String strEndtime;

	private int active;

	private Collection items;

	public int getActive() {
		return active;
	}

	public void setActive(int active) {
		this.active = active;
	}

	public Date getEndtime() {
		return endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getStartime() {
		return startime;
	}

	public void setStartime(Date startime) {
		this.startime = startime;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getVotecount() {
		return votecount;
	}

	public void setVotecount(int votecount) {
		this.votecount = votecount;
	}

	public String getStrEndtime() {
		if ((strEndtime == null) || (strEndtime.equals(""))) {
			if (getEndtime() != null) {
				SimpleDateFormat simpledate = new SimpleDateFormat(
						"yyyy-MM-dd");
				strEndtime = simpledate.format(getEndtime());
			}
		}
		return strEndtime;
	}

	public void setStrEndtime(String strEndtime) {
		this.strEndtime = strEndtime;
	}

	public String getStrStartime() {
		if ((strStartime == null) || (strStartime.equals(""))) {
			if (getStartime() != null) {
				SimpleDateFormat simpledate = new SimpleDateFormat(
						"yyyy-MM-dd");
				strStartime = simpledate.format(getStartime());
			}
		}
		return strStartime;
	}

	public void setStrStartime(String strStartime) {
		this.strStartime = strStartime;
	}

	public Collection getItems() {
		return items;
	}

	public void setItems(Collection items) {
		this.items = items;
	}
}
