21 package org.matsim.api.core.v01.events;
72 final String transactionPartner,
final String reference) {
74 this.personId = agentId;
85 this(
time, agentId,
amount, null, null, null);
93 final String transactionPartner) {
125 Map<String, String> attr = super.getAttributes();
127 attr.put(ATTRIBUTE_AMOUNT, Double.toString(
this.amount));
128 if (this.purpose != null) {
129 attr.put(ATTRIBUTE_PURPOSE, this.purpose);
131 if (this.transactionPartner != null) {
132 attr.put(ATTRIBUTE_TRANSACTION_PARTNER, this.transactionPartner);
134 if (this.reference != null) {
135 attr.put(ATTRIBUTE_REFERENCE, this.reference);
145 out.append(
"amount=\"").append(this.amount).append(
"\" ");
146 if (this.purpose != null) {
147 writeEncodedAttributeKeyValue(out, ATTRIBUTE_PURPOSE, this.purpose);
149 if (this.transactionPartner != null) {
150 writeEncodedAttributeKeyValue(out, ATTRIBUTE_TRANSACTION_PARTNER, this.transactionPartner);
152 if (this.reference != null) {
153 writeEncodedAttributeKeyValue(out, ATTRIBUTE_REFERENCE, this.reference);
PersonMoneyEvent(final double time, final Id< Person > agentId, final double amount)
final void writeXMLEnd(StringBuilder out)
static final String ATTRIBUTE_TRANSACTION_PARTNER
static final String ATTRIBUTE_PURPOSE
static final String EVENT_TYPE
static final String ATTRIBUTE_AMOUNT
PersonMoneyEvent(final double time, final Id< Person > agentId, final double amount, final String purpose, final String transactionPartner)
final void writeXMLStart(StringBuilder out)
Map< String, String > getAttributes()
String getTransactionPartner()
void writeAsXML(StringBuilder out)
final String transactionPartner
static final String ATTRIBUTE_REFERENCE
Id< Person > getPersonId()
PersonMoneyEvent(final double time, final Id< Person > agentId, final double amount, final String purpose, final String transactionPartner, final String reference)
static StringBuilder writeEncodedAttributeKeyValue(StringBuilder out, String key, String value)
final Id< Person > personId