ch.hsr.bieridee.models
Class RecommendationModel
java.lang.Object
ch.hsr.bieridee.models.AbstractModel
ch.hsr.bieridee.models.RecommendationModel
- All Implemented Interfaces:
- java.lang.Comparable<RecommendationModel>
public class RecommendationModel
- extends AbstractModel
- implements java.lang.Comparable<RecommendationModel>
RecommendationModel. This model contains no node, as it is completly calculated it has no need to be persisted in the
database.
The RecommendationModel is a wrapper for the recommendation-domainobject. It represents one recommedation and holds
the beer which is recommended and the user who gets the recommendation.
The decision/calculation on which beer is recommended happens in Recommendator.java
. (itz magic)
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RecommendationModel
public RecommendationModel(double weight,
double normalizedWeight,
UserModel forUser,
BeerModel beer)
- Creates a new RecommendationModel.
- Parameters:
weight
- Relevance of the recommendationnormalizedWeight
- Normalized relevance of the recommendationforUser
- The user to geht the recommendationbeer
- The recommended beer
getWeight
public double getWeight()
setWeight
public void setWeight(double weight)
getNormalizedWeight
public double getNormalizedWeight()
setNormalizedWeight
public void setNormalizedWeight(double weight)
getRoundedNormalizdWeight
public double getRoundedNormalizdWeight()
getUser
public UserModel getUser()
throws org.neo4j.graphdb.NotFoundException,
WrongNodeTypeException
- Throws:
org.neo4j.graphdb.NotFoundException
WrongNodeTypeException
setUser
public void setUser(UserModel user)
getBeer
public BeerModel getBeer()
throws org.neo4j.graphdb.NotFoundException,
WrongNodeTypeException
- Throws:
org.neo4j.graphdb.NotFoundException
WrongNodeTypeException
setBeer
public void setBeer(BeerModel beer)
compareTo
public int compareTo(RecommendationModel o)
- Specified by:
compareTo
in interface java.lang.Comparable<RecommendationModel>
getDomainObject
public IDomain getDomainObject()
- Specified by:
getDomainObject
in class AbstractModel