public class SpoiledVegetablesDeck<T extends Critiqueable>
extends java.lang.Object
Constructor and Description |
---|
SpoiledVegetablesDeck()
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(T newItem)
Adds an item to the SpoiledVegetablesDeck in a very special way.
|
Critiqueable[][] |
export2Darray()
The method will return a ragged 2D structure using the Java array.
|
java.util.ArrayList<java.util.ArrayList<Critiqueable>> |
export2Darraylist()
The method will return a ragged 2D structure using the ArrayList
data type - it will have references to deep copies of the Critiqueable
items currently stored in the SpoiledVegetablesDeck.
|
void |
freshenUp(int fanGain)
Goes through each item in the SpoiledVegetablesDeck and adds the
specified number of fans to every Critiqueable item it contains.
|
void |
rottenDown(int fanLoss)
Goes through each item in the SpoiledVegetablesDeck and deducts the
specified number of fans from every Critiqueable item it contains.
|
void |
shuffle()
Shuffles the contents of the deck in the way described here.
|
T |
solitaireCritique()
The method is meant to allow the next two Critiqueable items to be critiqued
against each other, and for the winner to be returned.
|
void |
sweepDeck()
Removes any Critiqueable item currently in the critique deck that have
fewer than three fans left.
|
java.lang.String |
toString()
The method will return a String object containing a representation
of the Critiqueable items currently held in the SpoiledVegetablesDeck,
shown in order from "front to back" of the ArrayList holding the references.
|
public SpoiledVegetablesDeck()
public void add(T newItem)
newItem
- refers to a Critiqueable item to be added to this SpoiledVegetablesDeckpublic void freshenUp(int fanGain)
fanGain
- the value to add to the number of fanspublic void rottenDown(int fanLoss)
fanLoss
- the value to deduct from the number of fanspublic void sweepDeck()
public void shuffle()
public T solitaireCritique()
public Critiqueable[][] export2Darray()
public java.util.ArrayList<java.util.ArrayList<Critiqueable>> export2Darraylist()
public java.lang.String toString()
toString
in class java.lang.Object