Code Search for Developers
 
 
  

IterationWeb.java from MASE: Agile Software Engineering at Krugle


Show IterationWeb.java syntax highlighted

package ucalgary.ebe.webui.client.data;

import java.util.Vector;

import com.google.gwt.user.client.rpc.IsSerializable;

public class IterationWeb implements IsSerializable {
	
	private static final String TIMESTAMP_PATTERN = "(\\d){4}-(\\d){2}-(\\d){2}(\\s(\\d){2}:(\\d){2}:(\\d){2}(\\.\\d{1,3})?)?";
	
	public static final String DEFAULT_TIMESTAMP = "2007-01-01";
	public static final String DEFAULT_NAME = "Default Iteration";
	public static final String DEFAULT_DESCRIPTION = "no description";
	public static final float DEFAULT_EFFORT = 0f;
	
	private long id, parent;
	private float availableEffort;
	
	private String name, description;
	private String startdate, enddate;

	private boolean completed;

	private Vector storycards;

	public IterationWeb() {
		this.id = 0;
		this.parent = 0;
		this.name = DEFAULT_NAME;
		this.description = DEFAULT_DESCRIPTION;
		this.availableEffort = DEFAULT_EFFORT;
		
		this.startdate = DEFAULT_TIMESTAMP;
		this.enddate = DEFAULT_TIMESTAMP;
		this.storycards = new Vector();
	}
	
	
	public IterationWeb(String name, String description, float availableEffort, String startDate, String endDate) {
		this.id = 0;
		this.parent = 0;
		this.name = name;
		this.description = description;
		this.availableEffort = availableEffort;
		
		//assure that dates do not contain nulls
		if((startDate != null) && (startDate.matches(TIMESTAMP_PATTERN))) {
			this.startdate = startDate;
		} else {
			this.startdate = DEFAULT_TIMESTAMP;
		}
		if((endDate != null) && (endDate.matches(TIMESTAMP_PATTERN))) {
			this.enddate = endDate;
		} else {
			this.enddate = DEFAULT_TIMESTAMP;
		}
		
		this.storycards = new Vector();
	}
	
	

	public IterationWeb(long id, long parentid, String name, String description, 
			float availableEffort, String startDate, String endDate) {
		this.id = id;
		this.parent = parentid;
		this.name = name;
		this.description = description;
		this.availableEffort = availableEffort;
		
		//assure that dates do not contain nulls
		if((startDate != null) && (startDate.matches(TIMESTAMP_PATTERN))) {
			this.startdate = startDate;
		} else {
			this.startdate = DEFAULT_TIMESTAMP;
		}
		if((endDate != null) && (endDate.matches(TIMESTAMP_PATTERN)) ){
			this.enddate = endDate;
		} else {
			this.enddate = DEFAULT_TIMESTAMP;
		}
		
		this.storycards = new Vector();
	}

	public float getAvailableEffort() {
		return this.availableEffort;
	}

	public String getEndDate() {
		return this.enddate;
	}

	public String getStartDate() {
		return this.startdate;
	}

	public void setAvailableEffort(float available) {
		this.availableEffort = available;

	}

	public void setEndDate(String enddate) {
		this.enddate = enddate;

	}

	public void setStartDate(String startdate) {
		this.startdate = startdate;

	}

	public void addStoryCard(StoryCardWeb storycard) {
		storycard.setParent(this.getId());
		this.storycards.add(storycard);
	}

	public Vector getStoryCardChildren() {
		return this.storycards;
	}

	public void removeStoryCard(StoryCardWeb storycard) {
		this.storycards.remove(storycard);

	}

	public String getDescription() {
		return this.description;
	}

	public boolean isCompleted() {
		return this.completed;
	}

	public void setCompleted(boolean completed) {
		this.completed = completed;

	}

	public void setDescription(String description) {
		this.description = description;

	}

	public long getId() {
		return this.id;
	}

	public String getName() {
		return this.name;
	}

	public long getParent() {
		return this.parent;
	}

	public void setId(long id) {
		this.id = id;

	}

	public void setName(String name) {
		this.name = name;

	}

	public void setParent(long id) {
		this.parent = id;

	}
	
	public String toString() {
		String iteration = "###################################\n"+
		"#            Iteration            #\n" +
		"###################################\n\n" +
				"ID:\t\t"+this.id+"\n"+
				"Parent:\t\t"+this.parent+"\n"+
				"Name:\t\t"+this.name+"\n"+
				"Description:\t"+this.description+"\n"+
				"Start date:\t"+this.startdate+"\n"+
				"End date:\t"+this.enddate+"\n"+
				"Available:\t"+this.availableEffort+"\n"+
				"Completed:\t"+this.completed+"\n\n";
		return iteration;
	}
	

	public boolean equals (Object o){
        if (o instanceof IterationWeb){
        	IterationWeb iteration = (IterationWeb) o;
            return iteration.getId() == this.getId();
        }
        else
            return false;
    }
	

    public int hashCode(){
        return (int)getId();
    }
}




See more files for this project here

MASE: Agile Software Engineering

The MASE project investigates methods to support the coordination and executable acceptance testing of software projects. Keywords: Agile methods, distributed teams, Extreme Programming. See http://ebe.cpsc.ucalgary.ca/ebe for more information.

Project homepage: http://sourceforge.net/projects/mase
Programming language(s): Java,XML
License: other

  BacklogWeb.java
  IterationWeb.java
  ProjectWeb.java
  StoryCardWeb.java