jitas.core
Class Problem

java.lang.Object
  extended by jitas.core.Problem
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Problem>

public class Problem
extends java.lang.Object
implements java.lang.Comparable<Problem>, java.io.Serializable

Create a Problem object which contains the necessary information.

Version:
15 May 2007
Author:
DeathMarch (c314g2)
See Also:
Serialized Form

Constructor Summary
Problem()
          Constructor-- Initialize the variables
 
Method Summary
 int compareTo(Problem object)
          Standard compareTo override, based on the Problem id
 boolean equals(java.lang.Object object)
          Standard equals override, based on the Problem id
 java.util.Map<java.lang.String,java.lang.String> getAdditionalData()
          Get the additional data associated with a problem
 int getDifficulty()
          Get the difficulty of a Problem
 int getId()
          Get the id of a Problem
 java.lang.String getProblemStatement()
          Get the problemStatement of a Problem
 java.lang.String getShortName()
          Get the short name of a problem
 Solution getSolution()
          Get the solution of a Problem
 int hashCode()
          Standard hashCode override, based on the Problem id
 void setAdditionalData(java.util.Map<java.lang.String,java.lang.String> additionalData)
          Set the additional data associated with a problem
 void setDifficulty(int difficulty)
          Set the difficulty of a Problem
 void setId(int id)
          Set the id of a Problem
 void setProblemStatement(java.lang.String problemStatement)
          Set the problemStatement of a Problem
 void setShortName(java.lang.String shortName)
          Set the short name of a problem
 void setSolution(Solution solution)
          Set the solution of a Problem
 void setSolution(java.lang.String s)
          Set the solution to a problem
 java.lang.String toString()
          Convert a problem to the XML format
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Problem

public Problem()
Constructor-- Initialize the variables

Method Detail

setId

public void setId(int id)
Set the id of a Problem

Parameters:
id - The id of a problem

setDifficulty

public void setDifficulty(int difficulty)
Set the difficulty of a Problem

Parameters:
difficulty - The difficulty level of a problem

setProblemStatement

public void setProblemStatement(java.lang.String problemStatement)
Set the problemStatement of a Problem

Parameters:
problemStatement - The statement of a problem

setSolution

public void setSolution(Solution solution)
Set the solution of a Problem

Parameters:
solution - The correct solution of problem

setSolution

public void setSolution(java.lang.String s)
Set the solution to a problem

Parameters:
s - The solution of a problem in string format
Throws:
InvalidSolutionException

getId

public int getId()
Get the id of a Problem

Returns:
id The id of a problem

getDifficulty

public int getDifficulty()
Get the difficulty of a Problem

Returns:
difficulty The difficulty of a problem

getProblemStatement

public java.lang.String getProblemStatement()
Get the problemStatement of a Problem

Returns:
A copy of the statement of a problem

getSolution

public Solution getSolution()
Get the solution of a Problem

Returns:
solution The solution of a problem

toString

public java.lang.String toString()
Convert a problem to the XML format

Overrides:
toString in class java.lang.Object
Returns:
the final string in XML format

equals

public boolean equals(java.lang.Object object)
Standard equals override, based on the Problem id

Overrides:
equals in class java.lang.Object
Returns:
True if the objects are equal

compareTo

public int compareTo(Problem object)
              throws java.lang.ClassCastException
Standard compareTo override, based on the Problem id

Specified by:
compareTo in interface java.lang.Comparable<Problem>
Parameters:
object - the Object to be compared
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException

hashCode

public int hashCode()
Standard hashCode override, based on the Problem id

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code of a problem

getShortName

public java.lang.String getShortName()
Get the short name of a problem

Returns:
shortName The short name of a problem

setShortName

public void setShortName(java.lang.String shortName)
Set the short name of a problem

Parameters:
shortName - The short name of a problem

getAdditionalData

public java.util.Map<java.lang.String,java.lang.String> getAdditionalData()
Get the additional data associated with a problem

Returns:
additionalData The additional data associated with a problem

setAdditionalData

public void setAdditionalData(java.util.Map<java.lang.String,java.lang.String> additionalData)
Set the additional data associated with a problem

Parameters:
additionalData - The additional data associated with a problem