cz.muni.fi.pclis.domain.learningContracts
Class LearningContract

java.lang.Object
  extended by cz.muni.fi.pclis.commons.domain.DomainObject
      extended by cz.muni.fi.pclis.domain.learningContracts.LearningContract
All Implemented Interfaces:
Comparable<LearningContract>

public class LearningContract
extends DomainObject
implements Comparable<LearningContract>

Entity representing Learning Contract User: Ľuboš Pecho Date: 9.2.2010 Time: 20:16:33


Field Summary
private  Set<ContractAddition> additions
          Addition added to this contract
private  User author
          Author of the contract
private  Course course
          Course in which the contract was created
private  String description
          Description of the contract
private  Term term
          Term in which the contract was created
private  String title
          Title of the contract
private  Set<UserVote> userVotes
          Users who voted for this contract
 
Constructor Summary
LearningContract()
           
 
Method Summary
 void addAddition(ContractAddition addition)
          Add an addition
 void addUserVote(User user)
          Add user who voted for this contract
 int compareTo(LearningContract o)
          Compares this contract according to count of user votes and the id
 Set<ContractAddition> getAdditions()
           
 int getAdditionsCount()
          Returns count of additinos
 User getAuthor()
           
 Course getCourse()
           
 String getDescription()
           
private  UserVote getOldestUserVote(User user)
           
 Date getOldestVoteDate(User user)
          Returns oldest vote date for user
 Term getTerm()
           
 String getTitle()
           
 Set<UserVote> getUserVotes()
           
 int getUserVotesCount(User user)
          Returns count votes of given user
 void removeOldestVote(User user)
          Removes oldes vote for user
 void setAdditions(Set<ContractAddition> additions)
          Sets the contract additions
 void setAuthor(User author)
          Sets the author
 void setCourse(Course course)
          Sets the course
 void setDescription(String description)
          Sets the description
 void setTerm(Term term)
          Sets the term
 void setTitle(String title)
          Sets the title
 void setUserVotes(Set<UserVote> userVotes)
           
 
Methods inherited from class cz.muni.fi.pclis.commons.domain.DomainObject
equals, getId, hashCode, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

author

private User author
Author of the contract


course

private Course course
Course in which the contract was created


term

private Term term
Term in which the contract was created


userVotes

private Set<UserVote> userVotes
Users who voted for this contract


title

private String title
Title of the contract


description

private String description
Description of the contract


additions

private Set<ContractAddition> additions
Addition added to this contract

Constructor Detail

LearningContract

public LearningContract()
Method Detail

getAuthor

public User getAuthor()
Returns:
author

setAuthor

public void setAuthor(User author)
Sets the author

Parameters:
author -

getCourse

public Course getCourse()
Returns:
course

setCourse

public void setCourse(Course course)
Sets the course

Parameters:
course -

getTerm

public Term getTerm()
Returns:
term

setTerm

public void setTerm(Term term)
Sets the term

Parameters:
term -

getUserVotes

public Set<UserVote> getUserVotes()
Returns:
user votes

setUserVotes

public void setUserVotes(Set<UserVote> userVotes)

addUserVote

public void addUserVote(User user)
Add user who voted for this contract

Parameters:
user -

getUserVotesCount

public int getUserVotesCount(User user)
Returns count votes of given user

Parameters:
user -
Returns:

getOldestVoteDate

public Date getOldestVoteDate(User user)
Returns oldest vote date for user

Parameters:
user -
Returns:

getOldestUserVote

private UserVote getOldestUserVote(User user)

removeOldestVote

public void removeOldestVote(User user)
Removes oldes vote for user

Parameters:
user -

getTitle

public String getTitle()
Returns:
title

setTitle

public void setTitle(String title)
Sets the title

Parameters:
title -

getDescription

public String getDescription()
Returns:
description

setDescription

public void setDescription(String description)
Sets the description

Parameters:
description -

getAdditions

public Set<ContractAddition> getAdditions()
Returns:
additions

setAdditions

public void setAdditions(Set<ContractAddition> additions)
Sets the contract additions

Parameters:
additions -

getAdditionsCount

public int getAdditionsCount()
Returns count of additinos

Returns:

addAddition

public void addAddition(ContractAddition addition)
Add an addition

Parameters:
addition -

compareTo

public int compareTo(LearningContract o)
Compares this contract according to count of user votes and the id

Specified by:
compareTo in interface Comparable<LearningContract>
Parameters:
o -
Returns:


Copyright © 2009-2010 Faculty of Informatics, Masaryk university, Brno. All Rights Reserved.