org.aspsimon.termcomp.entity
Class Category

java.lang.Object
  extended by org.aspsimon.termcomp.entity.Category
All Implemented Interfaces:
java.io.Serializable

public class Category
extends java.lang.Object
implements java.io.Serializable

Represents a category in the Competition. All categories have three common attributes: Name, Query and ProofTimeout. The query is a valid Hibernate query which returns the list of termination problems, functional or logic programs which represent the problem set for this category. Categories can be of three types:

Normal categories only have a single timeout, certifying categories however, have 2 timeouts -- one for termination and one for certifying the proof. Complexity categories have a boolean flag denoting the fact that they should be treated differently (see CompetitionJobExecutor for more details).

Version:
$Revision: 104 $
Author:
binabik
See Also:
Serialized Form

Constructor Summary
Category()
           
 
Method Summary
 java.lang.Long getCategoryId()
          Get the unique identifier for this Category.
 java.lang.Long getCertificationTimeout()
          Get the timeout allowed for certification of the proof.
 java.lang.Boolean getCertifying()
          Determines whether this category is a certifying category.
 java.lang.Boolean getComplexity()
          Determine whether this category is a complexity category.
 java.lang.String getName()
          Get the name of this category.
 java.lang.Long getProofTimeout()
          Get the timeout allowed for proving termination.
 java.lang.String getQuery()
          Get the Hibernate query for this category.
 void setCategoryId(java.lang.Long categoryId)
          Set the unique identifier for this Category.
 void setCertificationTimeout(java.lang.Long certificationTimeout)
          Set the certification timeout.
 void setCertifying(java.lang.Boolean certifying)
          Set whether this category is a certifying category.
 void setComplexity(java.lang.Boolean complexity)
          Set whether this category is a complexity category.
 void setName(java.lang.String name)
          Set the category name.
 void setProofTimeout(java.lang.Long proofTimeout)
          Set the proof timeout.
 void setQuery(java.lang.String query)
          Set the query which should return all the problems for this category.
 java.lang.String toString()
          Return a human-readable representation of this category.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Category

public Category()
Method Detail

getCategoryId

public java.lang.Long getCategoryId()
Get the unique identifier for this Category.

Returns:
A DB-generated identifier for internally referencing this Category. Globally unique.

getName

public java.lang.String getName()
Get the name of this category. The name should be unique, however there is no guarantee from the database end.

Returns:
The name of this category.

getQuery

public java.lang.String getQuery()
Get the Hibernate query for this category. Search parameters of the form #{true} or #{false} will be interpreted by the container's Hibernate implementation as 'true' or 'false', however any Hibernate implementation not running in a JavaEE container will need to replace these by their literal values.

Returns:
A Hibernate query for the problems contained in this category.

getProofTimeout

public java.lang.Long getProofTimeout()
Get the timeout allowed for proving termination.

Returns:
The timeout in seconds.

getCertificationTimeout

public java.lang.Long getCertificationTimeout()
Get the timeout allowed for certification of the proof. Only required for certifying categories, however this is not enforced in the database. Must be checked in userspace.

Returns:
The timeout for proving certification in seconds.

getComplexity

public java.lang.Boolean getComplexity()
Determine whether this category is a complexity category. These categories are treated differently in scoring.

Returns:
A boolean value representing the complexity status.

getCertifying

public java.lang.Boolean getCertifying()
Determines whether this category is a certifying category. These categories have a second step during competition execution.

Returns:
A boolean value representing the certification status.

setCategoryId

public void setCategoryId(java.lang.Long categoryId)
Set the unique identifier for this Category. Must be globally unique, otherwise the database will complain heavily. There is normally no need to actually use this call in normal programming.

Parameters:
categoryId - The categoryId to set.

setName

public void setName(java.lang.String name)
Set the category name. This name should be unique, uniqueness can be verified from a JSF page by using the CategoryNameValidator as a validator.

Parameters:
name - The category name to set.

setQuery

public void setQuery(java.lang.String query)
Set the query which should return all the problems for this category. The values #{true} and #{false} should be used for checking against boolean values.

Parameters:
query - The query to set. Must be a valid Hibernate query!

setProofTimeout

public void setProofTimeout(java.lang.Long proofTimeout)
Set the proof timeout.

Parameters:
proofTimeout - The timeout to set.

setCertificationTimeout

public void setCertificationTimeout(java.lang.Long certificationTimeout)
Set the certification timeout.

Parameters:
certificationTimeout - The certification timeout to set.

setComplexity

public void setComplexity(java.lang.Boolean complexity)
Set whether this category is a complexity category.

Parameters:
complexity - A boolean value.

setCertifying

public void setCertifying(java.lang.Boolean certifying)
Set whether this category is a certifying category.

Parameters:
certifying - A boolean value.

toString

public java.lang.String toString()
Return a human-readable representation of this category.

Overrides:
toString in class java.lang.Object
Returns:
The category name suffixed with the internal category id.