Skip to content

Instantly share code, notes, and snippets.

@vsoued
Created July 1, 2011 19:49
Show Gist options
  • Save vsoued/1059265 to your computer and use it in GitHub Desktop.
Save vsoued/1059265 to your computer and use it in GitHub Desktop.
Basic user class example
package edu.brandeis.vogueable;
import java.util.ArrayList;
import android.content.Context;
public class User {
private String name;
private ArrayList<Item> wishlist;
private TasteManager mytaste;
private Context con;
public User(String name, Context con){
this.name = name;
this.con = con;
wishlist = new ArrayList<Item>();
mytaste = new TasteManager(con);
}
public String getName(){
return name;
}
public Context getContext(){
return con;
}
public ArrayList<Item> getWishlist(){
return wishlist;
}
public void addToWishlist(Item item){
wishlist.add(item);
}
public void removeFromWishlist(Item item){
wishlist.remove(item);
}
public TasteManager getTasteManager(){
return mytaste;
}
public Item getItemFromWishlist(int i){
return wishlist.get(i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment