public class PriceStep
extends java.lang.Object
MarketBasis
. A priceStep is the index in the demand
array. This is an integer and can be any value between 0 and marketbasis.priceSteps. The value 0 corresponds to the
minimal price and marketbasis.priceStep - 1 corresponds to the the maximal price.Constructor and Description |
---|
PriceStep(MarketBasis marketBasis,
int priceStep)
A constructor that creates a new
PricePoint instance. |
Modifier and Type | Method and Description |
---|---|
PriceStep |
decrement() |
boolean |
equals(java.lang.Object obj) |
MarketBasis |
getMarketBasis() |
int |
getPriceStep() |
int |
hashCode() |
PriceStep |
increment() |
boolean |
isMaximum() |
boolean |
isMinimum() |
Price |
toPrice()
Creates a
Price , based on the MarketBasis as the priceStep. |
java.lang.String |
toString() |
public PriceStep(MarketBasis marketBasis, int priceStep)
PricePoint
instance.marketBasis
- the marketbasis of this cluster.priceStep
- the value of the priceStep.public MarketBasis getMarketBasis()
public int getPriceStep()
public boolean isMaximum()
PriceStep
is at its maximum (e.g. marketBasis.getPriceSteps() - 1)public boolean isMinimum()
PriceStep
is at its minimum (e.g. 0)public PriceStep increment()
PriceStep
that is exactly 1 step above the current.java.lang.IllegalStateException
- when it is already at its maximum level.public PriceStep decrement()
PriceStep
that is exactly 1 step below the current.java.lang.IllegalStateException
- when it is already at its minimum level.public Price toPrice()
Price
, based on the MarketBasis
as the priceStep.Price
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object