package net.ihypo.work;

import java.util.ArrayList;
import java.util.List;

public class WorkGroup {
	private List<Work> list;
	private int total;
	private int userId;
	
	public WorkGroup(int userId){
		list = new ArrayList<Work>();
		total = 0;
		this.userId = userId;
	}
	
	public void addWork(String title,int userId,String data){
		list.add(WorkFactory.createWork(title, userId, data));
	}
	
	public Work getWork(int id){
		int index = list.indexOf(new Work(id));
		if(index >= 0){
			return list.get(index);
		}
		return null;
	}
	
	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List<Work> getList() {
		return list;
	}

	public int getUserId() {
		return userId;
	}
	
	
}

@@ -325,16 +325,25 @@
 ing data
+,int rank
 )%7B%0A%09%09lis
@@ -390,16 +390,21 @@
 Id, data
+,rank
 ));%0A%09%7D%0A%09

add a function about work rank