|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ocopomo.endorsement.EndorsementScheme
public class EndorsementScheme
This class implements capabilities useful for the management of the endorsements schemes, allowing the mapping of the endorsements to numerical values
Constructor Summary | |
---|---|
EndorsementScheme(java.lang.String name,
double base)
|
Method Summary | |
---|---|
void |
addEndorsement(java.lang.String token,
int value)
Add an endorsement to the endorsement scheme. |
double |
endorsementPowerValue(java.util.ArrayList<java.lang.String> endorsements)
Returns a double that represents the evaluation of the ArrayList of endorsements in input in relation to the current endorsement scheme (calculated taken into consideration the scheme base). |
double |
endorsementPowerValue(java.lang.String[] endorsements)
Returns a double that represents the evaluation of the array of endorsements in input in relation to the current endorsement scheme (calculated taken into consideration the scheme base). |
double |
endorsementValue(java.util.ArrayList<java.lang.String> endorsements)
Returns a double that represents the evaluation of the ArrayList of endorsements in input in relation to the current endorsement scheme. |
double |
endorsementValue(java.lang.String[] endorsements)
Returns a double that represents the evaluation of the array of endorsements in input in relation to the current endorsement scheme. |
boolean |
existEndorsement(java.lang.String token)
Check whether the endorsement token is defined inside this endorsement scheme |
java.lang.String |
getName()
Returns the name of the current endorsement scheme |
java.lang.String |
getRandomToken()
Returns a token inside this endorsement scheme chosen randomly |
int |
numTokens()
|
void |
setName(java.lang.String val)
Sets the name of the current endorsement scheme |
java.lang.String |
toString()
Provides a String representation of the current endorsement scheme |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EndorsementScheme(java.lang.String name, double base)
Method Detail |
---|
public void addEndorsement(java.lang.String token, int value)
token
- The name of the endorsement to be addedvalue
- The numerical value of the new endorsementpublic int numTokens()
public java.lang.String getRandomToken()
public boolean existEndorsement(java.lang.String token)
token
- The endorsement token to check
public double endorsementValue(java.util.ArrayList<java.lang.String> endorsements)
endorsements
- An ArrayList containing the name of the endorsements
public double endorsementValue(java.lang.String[] endorsements)
endorsements
- An array containing the name of the endorsements
public double endorsementPowerValue(java.util.ArrayList<java.lang.String> endorsements)
endorsements
- An ArrayList containing the name of the endorsements
public double endorsementPowerValue(java.lang.String[] endorsements)
endorsements
- An array containing the name of the endorsements
public java.lang.String getName()
public void setName(java.lang.String val)
val
- the name to be setpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |