se.sj.stina.domain.provider
Class SjSalesControl

java.lang.Object
  extended by se.sj.stina.domain.provider.SjSalesControl
All Implemented Interfaces:
java.io.Serializable

public class SjSalesControl
extends java.lang.Object
implements java.io.Serializable

Represents the "Säljtabell" sales control table of the Swedish State Railways, Statens Järnvägar. For a gentle introduction to what's going on, refer to the document "Kopplingar och regler mellan olika begrepp i säljdialogen".

Author:
extamm
See Also:
Serialized Form

Constructor Summary
SjSalesControl(TiTransferPairsInterface aTPSalesControlData)
          Constructs a SjSalesControl object.
SjSalesControl(TiTransferPairsInterface aTPSalesControlData, TiCrossReference crossReference)
          Constructs a SjSalesControl object.
 
Method Summary
 java.util.Vector get(java.lang.String getWhat, TiDate when)
          Looks up a list of codes for a specified entity, valid on a specified date.
 java.util.Vector get(java.lang.String getWhat, TiDate when, java.lang.String kindOfPlacementCode)
          Looks up the valid values for a specified entity given a code for kind of placement.
 java.util.Vector get(java.lang.String getWhat, TiDate when, java.lang.String priceGroupCode, java.lang.String productCode)
          Looks up valid values (price level codes) for a combination of price group and product.
 java.lang.Object get(java.lang.String getWhat, TiDate when, java.lang.String priceGroupCode, java.lang.String productCode, java.lang.String priceLevelCode)
          Looks up the code for a specified entity given a combination of price group, product and price level.
 java.lang.Object get(java.util.Vector keyVector, java.lang.Object code)
          Generally looks up valid values according to input keys
 java.lang.Object get(java.util.Vector keys, java.lang.Object code, boolean useXRef)
           
 java.lang.String getDefault(java.lang.String getWhat, TiDate when, java.lang.String kindOfPlacementCode)
          Looks up the default for an entity given a code for kind of placement.
 java.lang.String getDefault(java.lang.String getWhat, TiDate when, java.lang.String priceGroupCode, java.lang.String productCode)
          Looks up the default (price level) for a combination of price group and product.
 java.lang.String getDefaultWithSpecificComfort(java.lang.String getWhat, TiDate when, java.lang.String priceGroupCode, java.lang.String productCode, java.lang.String comfortCode)
          Looks up the default (price level) for a combination of price group, product and a single allowed comfort.
 java.lang.Object getFromPriceGroup(java.lang.String getWhat, TiDate when, java.lang.String priceGroupCode)
           
 java.util.Vector getWithSpecificComfort(java.lang.String getWhat, TiDate when, java.lang.String priceGroupCode, java.lang.String productCode, java.lang.String comfortCode)
          Looks up valid values (price level codes) for a combination of price group, product and a single allowed comfort (reservation category).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SjSalesControl

public SjSalesControl(TiTransferPairsInterface aTPSalesControlData)
Constructs a SjSalesControl object.

Parameters:
aTPSalesControlData - The transferpair structure that represents the säljtabell. The structure is usually retrieved by calling SJPSession::getSalesControlData().

SjSalesControl

public SjSalesControl(TiTransferPairsInterface aTPSalesControlData,
                      TiCrossReference crossReference)
Constructs a SjSalesControl object.

Parameters:
aTPSalesControlData - The transferpair structure that represents the säljtabell. The structure is usually retrieved by calling SJPSession::getSalesControlData().
Method Detail

get

public java.lang.Object get(java.util.Vector keys,
                            java.lang.Object code,
                            boolean useXRef)

get

public java.lang.Object get(java.util.Vector keyVector,
                            java.lang.Object code)
Generally looks up valid values according to input keys

Parameters:
keyVector - A vector of keys indicating the sought field.
E. g. SJPConstants.SJPFSalesControlPriceLevelList.
code - a null key, a string key or a vector key
Returns:
An Object which is a String or a Vector or null.

get

public java.util.Vector get(java.lang.String getWhat,
                            TiDate when,
                            java.lang.String priceGroupCode,
                            java.lang.String productCode)
Looks up valid values (price level codes) for a combination of price group and product. The price level list is sorted as it was in the sales control data.

Parameters:
getWhat - String indicating the sought field.
E. g. SJPConstants.SJPFSalesControlPriceLevelList.
when - a Date
priceGroupCode - Code for price group (aka biljettyp, defaultgrupp, prisgrupp).
productCode - Code for product.
Returns:
A Vector with codes (String) for the valid price levels. Empty (non-null) Vector if no price levels can be found or the combination of arguments doesn't make sense.

getWithSpecificComfort

public java.util.Vector getWithSpecificComfort(java.lang.String getWhat,
                                               TiDate when,
                                               java.lang.String priceGroupCode,
                                               java.lang.String productCode,
                                               java.lang.String comfortCode)
Looks up valid values (price level codes) for a combination of price group, product and a single allowed comfort (reservation category). The price levels with a comfort not matching the passed one are filtered out from the list. The price level list is sorted as it was in the sales control data.

Parameters:
getWhat - String indicating the sought field.
I.e. SJPConstants.SJPFSalesControlPriceLevelList.
when - a Date
priceGroupCode - Code for price group (aka biljettyp, defaultgrupp, prisgrupp).
productCode - Code for product.
comfortCode - The only allowed comfort.
Returns:
A Vector with codes (String) for the valid price levels. Empty (non-null) Vector if no price levels can be found or the combination of arguments doesn't make sense.

get

public java.lang.Object get(java.lang.String getWhat,
                            TiDate when,
                            java.lang.String priceGroupCode,
                            java.lang.String productCode,
                            java.lang.String priceLevelCode)
Looks up the code for a specified entity given a combination of price group, product and price level.

Parameters:
getWhat - String indicating the sought field.
E. g. SJPConstants.SJPFConditionGroup.
when - a Date
priceGroupCode - Code for price group (aka biljettyp, defaultgrupp, prisgrupp).
productCode - Code for product.
priceLevelCode - Code for price level.
Returns:
A String representing a code. Empty (non-null) String if no code can be found or the combination of arguments doesn't make sense.

getDefault

public java.lang.String getDefault(java.lang.String getWhat,
                                   TiDate when,
                                   java.lang.String priceGroupCode,
                                   java.lang.String productCode)
Looks up the default (price level) for a combination of price group and product.

Parameters:
getWhat - String indicating the sought field.
E. g. SJPConstants.SJPFDefaultPriceLevelCode.
when - a Date
priceGroupCode - Code for price group (aka biljettyp, defaultgrupp, prisgrupp).
productCode - Code for product.
Returns:
A String with the code for the default price level. Empty (non-null) String if no default (price level) can be found or the combination of arguments doesn't make sense.

getDefaultWithSpecificComfort

public java.lang.String getDefaultWithSpecificComfort(java.lang.String getWhat,
                                                      TiDate when,
                                                      java.lang.String priceGroupCode,
                                                      java.lang.String productCode,
                                                      java.lang.String comfortCode)
Looks up the default (price level) for a combination of price group, product and a single allowed comfort.

Parameters:
getWhat - String indicating the sought field.
E. g. SJPConstants.SJPFDefaultPriceLevelCode.
when - a Date
priceGroupCode - Code for price group (aka biljettyp, defaultgrupp, prisgrupp).
productCode - Code for product.
comfortCode - The single allowed comfort.
Returns:
A String with the code for the default price level. Empty (non-null) String if no default (price level) can be found or the combination of arguments doesn't make sense.

getDefault

public java.lang.String getDefault(java.lang.String getWhat,
                                   TiDate when,
                                   java.lang.String kindOfPlacementCode)
Looks up the default for an entity given a code for kind of placement.

Parameters:
getWhat - String indicating the sought field.
E. g. SJPConstants.SJPFDefaultPlaceSpecificationCode.
when - a Date
kindOfPlacementCode - Code for kind of placement.
Returns:
A String with the code for the default value. Empty (non-null) String if no default can be found or the combination of arguments doesn't make sense.

get

public java.util.Vector get(java.lang.String getWhat,
                            TiDate when,
                            java.lang.String kindOfPlacementCode)
Looks up the valid values for a specified entity given a code for kind of placement.

Parameters:
getWhat - String indicating the sought field.
E. g. SJPConstants.SJPFPlacementOrientationList.
when - a Date, not in use at present.
kindOfPlacementCode - Code for kind of placement.
Returns:
A Vector with codes (String) for the valid values. Empty (non-null) Vector if no values can be found or the combination of arguments doesn't make sense.

getFromPriceGroup

public java.lang.Object getFromPriceGroup(java.lang.String getWhat,
                                          TiDate when,
                                          java.lang.String priceGroupCode)

get

public java.util.Vector get(java.lang.String getWhat,
                            TiDate when)
Looks up a list of codes for a specified entity, valid on a specified date.

Parameters:
getWhat - String indicating the sought field.
E. g. SJPConstants.SJPFDayPriceGroupList.
when - a Date
Returns:
A Vector of codes (String). Empty (non-null) Vector if no codes can be found or the argument doesn't make sense.


Copyright © 2012. All Rights Reserved.