Package org.compiere.model
Class MAssignmentSlot
java.lang.Object
org.compiere.model.MAssignmentSlot
- All Implemented Interfaces:
Comparator<Object>
Assignment Slot.
Display Information about Assignment Slot.
- Version:
- $Id: MAssignmentSlot.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
toString displays everythingstatic final int
toString displays formatted day time from-tostatic final int
toString displays formatted all infostatic final int
toString displays namestatic final int
toString displays name and optional descriptionstatic final int
toString displays formatted time fromstatic final int
toString displays formatted time from-tostatic final int
Confirmed Assignment Codestatic final int
Non-business Codestatic final int
Not Available Codestatic final int
Not confirmed Assignment Codestatic final int
Not in slot day Codestatic final int
Not in slot time Codestatic final int
Open Time Slot Codestatic final int
Un-Available Code -
Constructor Summary
ConstructorDescriptionComparator ConstructorMAssignmentSlot
(long startTime, long endTime) Time slot ConstructorMAssignmentSlot
(Timestamp startTime, Timestamp endTime) Time slot ConstructorMAssignmentSlot
(Timestamp startTime, Timestamp endTime, String name, String description, int status) Non Assignment ConstructorMAssignmentSlot
(MResourceAssignment assignment) Assignment Constructor -
Method Summary
Modifier and TypeMethodDescriptionint
Compares its two arguments for order.boolean
Indicates whether some other object is "equal to" this Comparator.getColor
(boolean background) Get Color for StatusGet DescriptionGet End timegetInfo()
Get Info with Date, Time From-To Name DescriptionGet Info with Date and Time From-ToGet Info with Name and optional DescriptionGet Info with Time FromGet Info with Time From-ToGet AssugnmentgetName()
Get NameGet Start timeint
Get Statusint
getXMax()
Get max X columnsint
getXPos()
Get X positionint
getYEnd()
Get Y end positionint
Get Y start positionint
hashCode()
HashCode of MAssignmentSlotboolean
Returns true if time is between start and end Time.boolean
Is this Slot an Assignment?void
setDescription
(String description) Set Descriptionvoid
setDisplay
(int displayMode) Set Display Mode of toString()void
setEndTime
(Timestamp endTime) Set End timevoid
setLanguage
(Language language) Set Languagevoid
setMAssignment
(MResourceAssignment assignment) Set Assignmentvoid
Set Namevoid
setStartTime
(Timestamp startTime) Set Start timevoid
setStatus
(int status) Set Statusvoid
setX
(int xPos, int xMax) Set X positionvoid
setY
(int yStart, int yEnd) Set Y positiontoString()
String representationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
STATUS_NotAvailable
public static final int STATUS_NotAvailableNot Available Code- See Also:
-
STATUS_UnAvailable
public static final int STATUS_UnAvailableUn-Available Code- See Also:
-
STATUS_NonBusinessDay
public static final int STATUS_NonBusinessDayNon-business Code- See Also:
-
STATUS_NotInSlotDay
public static final int STATUS_NotInSlotDayNot in slot day Code- See Also:
-
STATUS_NotInSlotTime
public static final int STATUS_NotInSlotTimeNot in slot time Code- See Also:
-
STATUS_NotConfirmed
public static final int STATUS_NotConfirmedNot confirmed Assignment Code- See Also:
-
STATUS_Confirmed
public static final int STATUS_ConfirmedConfirmed Assignment Code- See Also:
-
STATUS_TimeSlot
public static final int STATUS_TimeSlotOpen Time Slot Code- See Also:
-
DISPLAY_ALL
public static final int DISPLAY_ALLtoString displays everything- See Also:
-
DISPLAY_TIME_FROM
public static final int DISPLAY_TIME_FROMtoString displays formatted time from- See Also:
-
DISPLAY_TIME_FROM_TO
public static final int DISPLAY_TIME_FROM_TOtoString displays formatted time from-to- See Also:
-
DISPLAY_DATETIME_FROM_TO
public static final int DISPLAY_DATETIME_FROM_TOtoString displays formatted day time from-to- See Also:
-
DISPLAY_NAME
public static final int DISPLAY_NAMEtoString displays name- See Also:
-
DISPLAY_NAME_DESCRIPTION
public static final int DISPLAY_NAME_DESCRIPTIONtoString displays name and optional description- See Also:
-
DISPLAY_FULL
public static final int DISPLAY_FULLtoString displays formatted all info- See Also:
-
-
Constructor Details
-
MAssignmentSlot
public MAssignmentSlot()Comparator Constructor -
MAssignmentSlot
Time slot Constructor- Parameters:
startTime
- start timeendTime
- end time
-
MAssignmentSlot
public MAssignmentSlot(long startTime, long endTime) Time slot Constructor- Parameters:
startTime
- start time in millisecondendTime
- end time in millisecond
-
MAssignmentSlot
public MAssignmentSlot(Timestamp startTime, Timestamp endTime, String name, String description, int status) Non Assignment Constructor- Parameters:
startTime
- start timeendTime
- end timename
- namedescription
- descriptionstatus
- status
-
MAssignmentSlot
Assignment Constructor- Parameters:
assignment
- MAssignment
-
-
Method Details
-
setStatus
public void setStatus(int status) Set Status- Parameters:
status
- STATUS_..
-
getStatus
public int getStatus()Get Status- Returns:
- STATUS_..
-
isAssignment
public boolean isAssignment()Is this Slot an Assignment?- Returns:
- true if this slot is an assignment
-
getColor
Get Color for Status- Parameters:
background
- true if background - or foreground- Returns:
- Color
-
getStartTime
Get Start time- Returns:
- start time
-
setStartTime
Set Start time- Parameters:
startTime
- start time, if null use current time
-
getEndTime
Get End time- Returns:
- end time
-
setEndTime
Set End time- Parameters:
endTime
- end time, if null use start time
-
setMAssignment
Set Assignment- Parameters:
assignment
- MAssignment
-
getMAssignment
Get Assugnment- Returns:
- assignment
-
setName
Set Name- Parameters:
name
- name
-
getName
Get Name- Returns:
- name
-
setDescription
Set Description- Parameters:
description
- description
-
getDescription
Get Description- Returns:
- description
-
setY
public void setY(int yStart, int yEnd) Set Y position- Parameters:
yStart
- zero based Y start indexyEnd
- zero based Y end index
-
getYStart
public int getYStart()Get Y start position- Returns:
- zero based Y start index
-
getYEnd
public int getYEnd()Get Y end position- Returns:
- zero based Y end index
-
setX
public void setX(int xPos, int xMax) Set X position- Parameters:
xPos
- zero based X position indexxMax
- number of parallel columns
-
getXPos
public int getXPos()Get X position- Returns:
- zero based X position index
-
getXMax
public int getXMax()Get max X columns- Returns:
- number of max parallel columns
-
setLanguage
Set Language- Parameters:
language
- language
-
setDisplay
public void setDisplay(int displayMode) Set Display Mode of toString()- Parameters:
displayMode
- DISPLAY_
-
toString
String representation -
getInfoTimeFrom
Get Info with Time From- Returns:
- info 00:00
-
getInfoTimeFromTo
Get Info with Time From-To- Returns:
- info 00:00 - 01:00
-
getInfoDateTimeFromTo
Get Info with Date and Time From-To- Returns:
- info 12/12/01 00:00 - 01:00 or 12/12/01 00:00 - 12/13/01 01:00
-
getInfoNameDescription
Get Info with Name and optional Description- Returns:
- Name (Description)
-
getInfo
Get Info with Date, Time From-To Name Description- Returns:
- 12/12/01 00:00 - 01:00: Name (Description)
-
inSlot
Returns true if time is between start and end Time. Date part is ignored.Example: - Slots: 0:00-9:00 - 9:00-10:00 - 10:00-11:00 - ... - inSlot (9:00, false) -> 1 // start time - inSlot (10:00, true) -> 1 // end time
- Parameters:
time
- time of the dayendTime
- if true, the slot end time is included- Returns:
- true if within slot
-
compare
Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.- Specified by:
compare
in interfaceComparator<Object>
- Parameters:
o1
- the first object to be compared.o2
- the second object to be compared.- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
- Throws:
ClassCastException
- if the arguments' types prevent them from being compared by this Comparator.
-
equals
Indicates whether some other object is "equal to" this Comparator.- Specified by:
equals
in interfaceComparator<Object>
- Overrides:
equals
in classObject
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
only if the specified object is also a comparator and it imposes the same ordering as this comparator.- See Also:
-
hashCode
public int hashCode()HashCode of MAssignmentSlot
-