public class Bid
extends java.lang.Object
implements java.io.Serializable
Bid is a immutable. But you can create modified copies using
putValue(int, Value).
Bid should be considered final so do not extend this.
| Constructor and Description |
|---|
Bid(Bid bid)
This method clones the given bid.
|
Bid(Domain domain)
Create a new empty bid of which the values still must be set.
|
Bid(Domain domain,
java.util.Collection<IssueValue> values)
create bid from set of
IssueValues |
Bid(Domain domainP,
java.util.HashMap<java.lang.Integer,Value> bidP)
createFrom a new bid in a domain.
|
| Modifier and Type | Method and Description |
|---|---|
int |
countEqualValues(Bid b)
Counts the number of equal values with another bid (assuming they are defined on the same domain)
|
boolean |
equals(Bid pBid) |
boolean |
equals(java.lang.Object obj) |
Domain |
getDomain() |
java.util.List<Issue> |
getIssues() |
Value |
getValue(int issueNr) |
java.util.HashMap<java.lang.Integer,Value> |
getValues() |
int |
hashCode() |
Bid |
putValue(int issueId,
Value pValue) |
java.lang.String |
toString() |
public Bid(Domain domain)
domain - the domain for this bidpublic Bid(Domain domainP, java.util.HashMap<java.lang.Integer,Value> bidP)
domainP - the domain in which the bid is donebidP - HashMap, which is a set of pairs [issueID,value]public Bid(Domain domain, java.util.Collection<IssueValue> values)
IssueValuesdomain - the Domainvalues - a Collection of IssueValuespublic Bid(Bid bid)
bid - the bid to clonepublic Value getValue(int issueNr)
issueNr - number of an issue.java.lang.IllegalArgumentException - if there exist no issue with the given number.public Bid putValue(int issueId, Value pValue)
issueId - unique ID of an issue.pValue - value of the issue.java.lang.IllegalArgumentException - if there exist no issue with the given number.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(Bid pBid)
pBid - to which this bid must be compared.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.util.HashMap<java.lang.Integer,Value> getValues()
Map here but that may break
many agents.public java.util.List<Issue> getIssues()
public Domain getDomain()
public int countEqualValues(Bid b)
public int hashCode()
hashCode in class java.lang.Object