|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.jhu.cs.oose.elevel.dataModel.Card
public class Card
Card represents the high-level intuition of a flash card. Card represents a single card in
a Deck and maintains all the features of a real flash-card as well as additional, computer-only
possibilities.
| Field Summary | |
|---|---|
java.lang.String |
answer
A String representing the answer associated with this Card |
java.lang.String |
question
A String representing the question associated with this Card |
| Constructor Summary | |
|---|---|
Card()
Instantiates a new Card |
|
Card(java.lang.String q,
java.lang.String a,
java.lang.String h,
java.lang.String i)
Instantiates a Card with the specified parameters. |
|
| Method Summary | |
|---|---|
boolean |
checkAnswer(java.lang.String a)
Compares the provided String with this Card's correct answer |
boolean |
equals(Card other)
a comparison on hash codes |
java.lang.String |
getAdditionalInfo()
Returns the additional information associated with this card |
java.lang.String |
getAnswer()
Returns the answer associated with this Card |
java.lang.String |
getHint()
Get this Card's current hint |
int |
getID()
gets the card's deck-dependent ID. |
java.util.Map<java.lang.String,java.lang.Boolean> |
getOptions()
Gets the cards options |
java.lang.String |
getQuestion()
Returns this Card's question |
int |
hashCode()
Computes the hash code of this card based on its question, answer, hint, additional information, and options fields. |
void |
setAdditionalInfo(java.lang.String i)
Sets the additional information associated with this card to the specified String |
void |
setHint(java.lang.String h)
Sets the hint associated with this card to the specified String |
void |
setSetting(java.lang.String key,
java.lang.Boolean value)
Set the provided setting. |
void |
setValues(java.lang.String q,
java.lang.String a,
java.lang.String h,
java.lang.String i,
java.util.Map<java.lang.String,java.lang.Boolean> pref)
Set the values of this Card |
java.lang.String |
toString()
Writes out the properties of the card |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String question
String representing the question associated with this Card
public java.lang.String answer
String representing the answer associated with this Card
| Constructor Detail |
|---|
public Card()
public Card(java.lang.String q,
java.lang.String a,
java.lang.String h,
java.lang.String i)
Card with the specified parameters.
q - a String representing the question associated with this Carda - a String representing the answer associated with this Cardh - a String representing the hint associated with this Cardi - a String representing the additional information associated with this Card| Method Detail |
|---|
public boolean checkAnswer(java.lang.String a)
String with this Card's correct answer
a - a String representing the provided answer
true if the answer sent matches, false otherwisepublic boolean equals(Card other)
other - the card to be compared to this card
public int getID()
public java.lang.String getAdditionalInfo()
String representing the additional information associated with this Cardpublic java.lang.String getAnswer()
Card
String representing this Card's answerpublic java.lang.String getHint()
Card's current hint
public java.util.Map<java.lang.String,java.lang.Boolean> getOptions()
public java.lang.String getQuestion()
Card's question
public int hashCode()
hashCode in class java.lang.Objectpublic void setAdditionalInfo(java.lang.String i)
String
i - a String representing the card's additional informationpublic void setHint(java.lang.String h)
String
h - a String representing the card's hint
public void setSetting(java.lang.String key,
java.lang.Boolean value)
key - The setting namevalue - the Boolean value
public void setValues(java.lang.String q,
java.lang.String a,
java.lang.String h,
java.lang.String i,
java.util.Map<java.lang.String,java.lang.Boolean> pref)
Card
q - a String representing the question associated with this Carda - a String representing the answer associated with this Cardh - a String representing the hint associated with this Cardi - a String representing the additional information associated with this Cardpref - A Map representing the options associated with this Cardpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||