public class TradingManager
extends java.lang.Object
addID(Long)
method is used to iteratively add the identifiers that are still desired. The
single mode identifiers are returned by getSingleModeIDs()
. The
batch mode identifiers are returned by getBatchModeIDs()
(these will
always be null if the original input is single mode). The
newBatch(List)
method can be used as a shortcut to create different
mangers for each CatEntryPrices
object as needed.
Note that before using either of the output methods, isValid()
must
be called to determine if the outputs are valid. This manager may be made
invalid by adding an identifier that is not entitled, or by adding one that
would be impossible to obtain from the original inputs.
Constructor and Description |
---|
TradingManager(java.util.List<java.lang.Long> newEntitled,
java.util.List<java.lang.Long> newCurrent,
java.util.List<java.lang.Long> newSingleMode)
Constructor for TradingManager that is used to handle single mode.
|
TradingManager(java.util.List<java.lang.Long> newEntitled,
java.util.List<java.lang.Long> newCurrent,
java.util.List<java.lang.Long> newSingleMode,
java.util.List<java.lang.Long> newBatchMode)
Constructor for TradingManager that is used to handle batch mode.
|
Modifier and Type | Method and Description |
---|---|
void |
addID(java.lang.Long id)
Adds the given trading agreement identifier to be managed by this.
|
MixList<java.lang.Long> |
getBasePool()
Returns the trading agreement identifier "pool" which will contain the
allowed identifiers.
|
MixList<java.lang.Long> |
getBatchModeIDs()
Returns the batch mode trading agreement identifiers that will allow all
the accumulated identifiers to be processed as expected.
|
MixList<java.lang.Long> |
getSingleModeIDs()
Returns the single mode trading agreement identifiers that will allow all
the accumulated identifiers to be processed as expected.
|
boolean |
isValid()
Returns whether the accumulated trading agreement identifiers are valid,
using the original input to limit which identifiers are valid.
|
TradingManager |
newBatch(java.util.List<java.lang.Long> newBatchMode)
Creates a new version of a batch trading agreement manager.
|
java.lang.String |
toString()
Returns the string representation of this, including the entitled,
current, single mode, (if applicable) batch mode, and accumulated
identifiers.
|
public TradingManager(java.util.List<java.lang.Long> newEntitled, java.util.List<java.lang.Long> newCurrent, java.util.List<java.lang.Long> newSingleMode)
newEntitled
- The trading agreement identifiers that the user is entitled to
use. All contracts added to this must be in this list. Cannot
be null or empty.newCurrent
- The trading agreement identifiers that the user is currently
using. These will be used to determine the allowed default
trading agreements, and will limit which contracts can be
added if defaults are used. Every element in this list must
also be in eligibleTradingIDs
(although the
reverse is not necessarily true). Cannot be null or empty.newSingleMode
- The trading agreement identifiers that were set by calling
GetContractUnitPriceCmd.setTradingIds(Long[])
(or from
one of the other price commands) on the original input. May be
null or empty.public TradingManager(java.util.List<java.lang.Long> newEntitled, java.util.List<java.lang.Long> newCurrent, java.util.List<java.lang.Long> newSingleMode, java.util.List<java.lang.Long> newBatchMode)
newEntitled
- The trading agreement identifiers that the user is entitled to
use. All contracts added to this must be in this list. Cannot
be null or empty.newCurrent
- The trading agreement identifiers that the user is currently
using. These will be used to determine the allowed default
trading agreements, and will limit which contracts can be
added if defaults are used. Every element in this list must
also be in eligibleTradingIDs
(although the
reverse is not necessarily true). Cannot be null or empty.newSingleMode
- The trading agreement identifiers that were set by calling
GetContractUnitPriceCmd.setTradingIds(Long[])
(or from
one of the other price commands) on the original input. May be
null or empty.newBatchMode
- The trading agreement identifiers that were set by calling
CatEntryPrices.setTradingIds(Long[])
on the original
input. May be null or empty.public void addID(java.lang.Long id)
id
- The trading agreement identifier to add. Cannot be null.public MixList<java.lang.Long> getBasePool()
public MixList<java.lang.Long> getBatchModeIDs()
CatEntryPrices.setTradingIds(Long[])
, and so is only useful in
batch mode.public MixList<java.lang.Long> getSingleModeIDs()
GetContractUnitPriceCmd.setTradingIds(Long[])
(or a similar
method in the other price commands), but should be used in both single
and batch mode, since both modes can be influenced.public boolean isValid()
getSingleModeIDs()
and
getBatchModeIDs()
may be called without problems, false
otherwise.public TradingManager newBatch(java.util.List<java.lang.Long> newBatchMode) throws java.lang.IllegalStateException
newBatchMode
- The batch mode trading agreement identifiers for a different
input catalog entry than this was used for. May be null or
empty.java.lang.IllegalStateException
- If this is not used to manage batch trading agreement
identifiers.public java.lang.String toString()
toString
in class java.lang.Object