public class TestUser extends User
It is not recommended that developers generate new instances of this class since this is a memory-structural class.
Modifier and Type | Field and Description |
---|---|
protected double |
averageTest
Average test rating
|
protected double |
maxTest
Maximum test rating value
|
protected double |
minTest
Minimum test rating value
|
protected SortedRatingList |
testItemsRatings
TestItems rated by the user
|
protected int |
testUserIndex
Index in the DataModel array which stores test users
|
Constructor and Description |
---|
TestUser(String id,
int userIndex,
int testUserIndex)
Creates a new instance of a test user.
|
Modifier and Type | Method and Description |
---|---|
void |
addTestRating(int testItemIndex,
double rating)
Adds a new test rating of the test user to an test item.
|
double |
getMaxTestRating()
Gets the maximum test rating of the user
|
double |
getMinTestRating()
Gets the minimum test rating of the user
|
int |
getNumberOfTestRatings()
Gets the number of test items rated by the user.
|
int |
getTestItemAt(int pos)
Returns the index of the TestItem rated by the TestUser at the given position.
|
double |
getTestRatingAt(int pos)
Returns the test rating of the user to the test item at the pos position
|
double |
getTestRatingAverage()
Gets the average value of test ratings
|
int |
getTestUserIndex()
Returns the test user index inside the DataModel
|
addRating, findItem, getDataBank, getId, getItemAt, getMaxRating, getMinRating, getNumberOfRatings, getRatingAt, getRatingAverage, getUserIndex
protected int testUserIndex
protected double minTest
protected double maxTest
protected double averageTest
protected SortedRatingList testItemsRatings
public TestUser(String id, int userIndex, int testUserIndex)
id
- User unique identifieruserIndex
- Index in the DataModel array which stores userstestUserIndex
- Index in the DataModel array which stores test userspublic int getTestUserIndex()
public int getTestItemAt(int pos)
pos
- Positionpublic double getTestRatingAt(int pos)
pos
- Positionpublic int getNumberOfTestRatings()
public void addTestRating(int testItemIndex, double rating)
testItemIndex
- Test item index which identifies a test item in the DataModelrating
- Rating valuepublic double getMinTestRating()
public double getMaxTestRating()
public double getTestRatingAverage()
Copyright © 2020. All rights reserved.