public class Modifiers extends Object
Constructor and Description |
---|
Modifiers()
Creates a new Modifiers object retrieving the modifier definitions from
the resource 'Tickets.Modifiers'.
|
Modifiers(User oUser) |
Modifiers(UserView oUser)
Creates a new Modifiers object and sets the user mask.
|
Modifier and Type | Method and Description |
---|---|
int |
_getMask()
Retrieves the currently active modifiers in mask.
|
static void |
clearInputValue()
Clear the memorized input value (set to 0.0)
|
static int |
getCustomerGroupMask(TicketLine line)
Retrieves the active modifier mask for a customergroup
|
static int |
getCustomerMask(TicketLine line)
Retrieves the active modifier mask for a customer
|
int |
getDefaultCustomerGroupMask()
Use this method to assign a default mask for a new customer group
The value is taken from ticket.modifiers.xml
|
int |
getDefaultCustomerMask()
Use this method to assign a default mask for a new customer
The value is taken from ticket.modifiers.xml
|
int |
getDefaultProductExcludeMask()
Use this method to assign a default mask for a new products excluded modifiers.
|
int |
getDefaultProductMask()
Use this method to assign a default mask for a new products active modifiers.
|
int |
getDefaultUserMask()
Use this method to assign a default mask for a new user
The value is taken from ticket.modifiers.xml
|
String |
getDisplayNames(int mask)
Retrieve the display names for all modifiers in the mask.
|
String |
getDisplayNames(TicketLine oLine)
Retrieve the display names for all modifiers to be applied.
|
int |
getGastroMask() |
static double |
getInputValue()
Used to pass an input value to a modifier function
|
static Modifiers |
getInstance() |
int[] |
getModifierIndices(int mask)
Lists the indices represented by mask (for the notion of indices see
setModifierMask).
|
HashMap<Integer,String> |
getModifierMap()
Returns a list of all modifiers defined
|
String[] |
getModifierNames()
Lists the names of all defined modifiers.
|
int |
getRetailMask() |
int |
indicesToMask(int[] indices)
Create a modifier mask from the given indices.
|
void |
modifyTicketline(TicketLine oTicketline)
Modifies oTicketline according to the active modifiers.
|
void |
resetActive() |
int |
set(int oMask,
int mask,
Date lineDate)
Unlike setActive(mask) this function does not change the value of activeMask.
|
int |
setActive(int mask) |
int |
setActive(int mask,
Date lineDate)
Activates the modifiers in mask. set checks which modifiers are excluded
by those in mask and deactivates them.
|
static void |
setInputValue(double inputValue)
Store an input value to be used by a modifier function
|
void |
setUser(User oUser) |
int |
toggle(int oldMask,
int mask,
Date lineDate)
Unlike toggleActive(mask) this function does not change the value of
activeMask.
|
int |
toggleActive(int mask,
Date lineDate)
Toggle the modifiers in mask
|
int |
unset(int oldMask,
int mask)
Unlike unsetActive(mask) this function does not change the value of
activeMask.
|
int |
unsetActive(int mask)
Deactivates the modifiers in mask.
|
public Modifiers()
public Modifiers(UserView oUser)
oUser
- public Modifiers(User oUser)
public static double getInputValue()
public static void clearInputValue()
public static void setInputValue(double inputValue)
inputValue
- public void setUser(User oUser)
public static Modifiers getInstance()
public HashMap<Integer,String> getModifierMap()
public String[] getModifierNames()
public int indicesToMask(int[] indices)
indices
- an array of integers each representing the index (not the Id)
of a modifier in Ticket.Modifiers.public int[] getModifierIndices(int mask)
mask
- is a modifier maskpublic int setActive(int mask, Date lineDate)
mask
- a bit mask of modifiers to be activatedlineDate
- exclude timer excluded modifierspublic int setActive(int mask)
public int set(int oMask, int mask, Date lineDate)
oMask
- mask to be changedmask
- mask to be added
modifiers in mask are added to oldMasklineDate
- exclude timer excluded modifierspublic int unsetActive(int mask)
mask
- a bit mask of modifiers to be deactivatedpublic void resetActive()
public int unset(int oldMask, int mask)
oldMask
- the base maskmask
- modifiers in mask are subrtacted from oldMaskpublic int toggleActive(int mask, Date lineDate)
mask
- a bit mask of modifiers to be toggledlineDate
- exclude timer excluded modifiers by lineDatepublic int toggle(int oldMask, int mask, Date lineDate)
oldMask
- the base maskmask
- modifiers in mask are toggled in oldMasklineDate
- exclude timer excluded modifiers by lineDatepublic int _getMask()
public String getDisplayNames(int mask)
mask
- input maskpublic String getDisplayNames(TicketLine oLine)
oLine
- the line to get the modifiers frompublic int getDefaultUserMask()
public int getDefaultCustomerMask()
public int getDefaultCustomerGroupMask()
public int getDefaultProductMask()
public int getDefaultProductExcludeMask()
public int getRetailMask()
public int getGastroMask()
public void modifyTicketline(TicketLine oTicketline)
oTicketline
- public static int getCustomerMask(TicketLine line)
line
- public static int getCustomerGroupMask(TicketLine line)
line
- ticketline to retrieve the mask fromCopyright © 2021. All rights reserved.