MATSIM
Volume.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * Volume.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.counts;
22 // import org.matsim.demandmodeling.gbl.Gbl;
23 
27 public class Volume {
28  private final int h_;
29  private double val_;
30 
31  protected Volume(final int h, final double val) {
32 
33  /* no error checking needed as we use schema instead of dtd
34 
35  if ((h == -1)) {
36  Gbl.errorMsg("[h="+h+", negative values are not allowed!]");
37  }
38  if ((val == -1)) {
39  Gbl.errorMsg("[val="+val+", negative values are not allowed!]");
40  }
41  */
42 
43  this.h_ = h;
44  this.val_ = val;
45  }
46 
47  public final void setValue(double val) {
48  this.val_ = val;
49  }
50 
51  public final int getHourOfDayStartingWithOne() {
52  return this.h_;
53  }
54  public final double getValue() {
55  return this.val_;
56  }
57 
58  @Override
59  public final String toString() {
60  return "[" + this.h_ + "===" + this.val_ + "]";
61  }
62 }
final void setValue(double val)
Definition: Volume.java:47
final double getValue()
Definition: Volume.java:54
final int getHourOfDayStartingWithOne()
Definition: Volume.java:51
Volume(final int h, final double val)
Definition: Volume.java:31
final String toString()
Definition: Volume.java:59