MATSIM
Entry.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * Entry.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.matrices;
22 
23 public class Entry {
24 
26  // member variables
28 
29  private final String f_loc;
30  private final String t_loc;
31  private double value;
32 
34  // Constructors
36 
37  protected Entry(final String f_loc, final String t_loc, final double value) {
38  if ((f_loc == null)||(t_loc == null)) {
39  throw new RuntimeException("[f_loc="+f_loc+",t_loc="+t_loc+", 'null' is not allowed!]");
40  }
41  this.f_loc = f_loc;
42  this.t_loc = t_loc;
43  this.value = value;
44  }
45 
47  // create methods
49 
51  // set/add methods
53  public final void setValue(final double value) {
54  this.value = value;
55  }
56 
58  // get methods
60 
61  public final String getFromLocation() {
62  return this.f_loc;
63  }
64 
65  public final String getToLocation() {
66  return this.t_loc;
67  }
68 
69  public final double getValue() {
70  return this.value;
71  }
72 
74  // print methods
76 
77  @Override
78  public final String toString() {
79  return "[" + this.f_loc + "===" + this.value + "==>" + this.t_loc + "]";
80  }
81 }
final String getFromLocation()
Definition: Entry.java:61
Definition: Entry.java:23
final String toString()
Definition: Entry.java:78
final String getToLocation()
Definition: Entry.java:65
final String f_loc
Definition: Entry.java:29
final String t_loc
Definition: Entry.java:30
Entry(final String f_loc, final String t_loc, final double value)
Definition: Entry.java:37
double value
Definition: Entry.java:31
final double getValue()
Definition: Entry.java:69
final void setValue(final double value)
Definition: Entry.java:53