EMlab-generation Documentation  1.0
Documentation of the EMLab-Generation model.
ClearingPoint.java
1 /*******************************************************************************
2  * Copyright 2012 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************/
16 package emlab.gen.domain.market;
17 
18 import org.neo4j.graphdb.Direction;
19 import org.springframework.data.neo4j.annotation.NodeEntity;
20 import org.springframework.data.neo4j.annotation.RelatedTo;
21 import org.springframework.transaction.annotation.Transactional;
22 
29 @NodeEntity
30 public class ClearingPoint {
31 
32  @RelatedTo(type = "MARKET_POINT", elementClass = DecarbonizationMarket.class, direction = Direction.OUTGOING)
33  DecarbonizationMarket abstractMarket;
34 
35  private double price;
36  private double volume;
37  private long time;
38  private boolean forecast;
39 
40  public double getPrice() {
41  return price;
42  }
43 
44  public void setPrice(double price) {
45  this.price = price;
46  }
47 
48  public double getVolume() {
49  return volume;
50  }
51 
52  public void setVolume(double volume) {
53  this.volume = volume;
54  }
55 
56  public long getTime() {
57  return time;
58  }
59 
60  public void setTime(long time) {
61  this.time = time;
62  }
63 
64  public DecarbonizationMarket getAbstractMarket() {
65  return abstractMarket;
66  }
67 
68  public void setAbstractMarket(DecarbonizationMarket abstractMarket) {
69  this.abstractMarket = abstractMarket;
70  }
71 
72  @Override
73  public String toString() {
74  return " market: " + abstractMarket + ", price " + price + ", volume " + volume + ", time " + time;
75  }
76 
77  @Transactional
78  public void updateAbstractMarket(DecarbonizationMarket market) {
79  setAbstractMarket(market);
80  }
81 
82  public boolean isForecast() {
83  return forecast;
84  }
85 
86  public void setForecast(boolean forecast) {
87  this.forecast = forecast;
88  }
89 }