org.flexiblepower.ral.values
public class CommoditySet extends java.util.AbstractSet<Commodity<?,?>>
Commodity
instances are in this Set
. It does not store
real references, but instead keeps track using boolean values.Modifier and Type | Class and Description |
---|---|
static class |
CommoditySet.Builder
This helper class makes it easy to create an instance of the
CommoditySet . |
Modifier and Type | Field and Description |
---|---|
static CommoditySet |
empty
An empty set (will return false for all contains methods).
|
static CommoditySet |
onlyElectricity
The CommoditySet that will only contain
Commodity.ELECTRICITY . |
static CommoditySet |
onlyGas
The CommoditySet that will only contain
Commodity.GAS . |
static CommoditySet |
onlyHeat
The CommoditySet that will only contain
Commodity.HEAT . |
Constructor and Description |
---|
CommoditySet(java.util.Collection<Commodity<?,?>> collection)
The copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.Object o) |
static CommoditySet.Builder |
create() |
boolean |
isEmpty() |
java.util.Iterator<Commodity<?,?>> |
iterator() |
int |
size() |
add, addAll, clear, containsAll, remove, retainAll, toArray, toArray, toString
public static final CommoditySet empty
public static final CommoditySet onlyElectricity
Commodity.ELECTRICITY
.public static final CommoditySet onlyGas
Commodity.GAS
.public static final CommoditySet onlyHeat
Commodity.HEAT
.public CommoditySet(java.util.Collection<Commodity<?,?>> collection)
collection
- The other collection from which will be checked if one of the commodities should be in this set.public static CommoditySet.Builder create()
CommoditySet.Builder
to easily create your own CommoditySetpublic boolean contains(java.lang.Object o)
public java.util.Iterator<Commodity<?,?>> iterator()
public int size()