Created
July 1, 2011 19:52
-
-
Save vsoued/1059270 to your computer and use it in GitHub Desktop.
User class with solid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.brandeis.vogueable; | |
import java.util.ArrayList; | |
import android.content.Context; | |
public class User { | |
private String name; | |
private Wishlist wishlist; | |
private TasteManager mytaste; | |
private Context con; | |
public User(String name, Context con){ | |
this.name = name; | |
this.con = con; | |
wishlist = new Wishlist(); | |
mytaste = new TasteManager(con); | |
} | |
public String getName(){ | |
return name; | |
} | |
public Context getContext(){ | |
return con; | |
} | |
public Wishlist getWishlist(){ | |
return wishlist; | |
} | |
public TasteManager getTasteManager(){ | |
return mytaste; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.brandeis.vogueable; | |
import java.util.ArrayList; | |
public class Wishlist { | |
private ArrayList<Item> wishlist; | |
public Wishlist(){ | |
wishlist = new ArrayList<Item>(); | |
} | |
public ArrayList<Item> showWishlist(){ | |
return wishlist; | |
} | |
public void addToWishlist(Item item){ | |
wishlist.add(item); | |
} | |
public void removeFromWishlist(Item item){ | |
wishlist.remove(item); | |
} | |
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