Compiere 3.1

org.compiere.model
Class MAssignmentSlot

java.lang.Object
  extended by org.compiere.model.MAssignmentSlot
All Implemented Interfaces:
Comparable<MAssignmentSlot>

public class MAssignmentSlot
extends Object
implements Comparable<MAssignmentSlot>

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
static int DISPLAY_ALL
          toString displays everything
static int DISPLAY_DATETIME_FROM_TO
          toString displays formatted day time from-to
static int DISPLAY_FULL
          toString displays formatted all info
static int DISPLAY_NAME
          toString displays name
static int DISPLAY_NAME_DESCRIPTION
          toString displays name and optional description
static int DISPLAY_TIME_FROM
          toString displays formatted time from
static int DISPLAY_TIME_FROM_TO
          toString displays formatted time from-to
static int STATUS_Confirmed
          Assignment Code
static int STATUS_NonBusinessDay
          Not Available Code
static int STATUS_NotAvailable
          Not Available Code
static int STATUS_NotConfirmed
          Assignment Code
static int STATUS_NotInSlotDay
          Not Available Code
static int STATUS_NotInSlotTime
          Not Available Code
static int STATUS_TimeSlot
          Assignment Code
static int STATUS_UnAvailable
          Not Available Code
 
Constructor Summary
MAssignmentSlot()
          Comparator Constructor
MAssignmentSlot(long startTime, long endTime)
          Timeslot Constructor
MAssignmentSlot(MResourceAssignment assignment)
          Assignment Constructor
MAssignmentSlot(Timestamp startTime, Timestamp endTime)
          Timeslot Constructor
MAssignmentSlot(Timestamp startTime, Timestamp endTime, String name, String description, int status)
          Non Assignment Constructor
 
Method Summary
 int compareTo(MAssignmentSlot slot)
          Compares its two arguments for order.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this Comparator.
 Color getColor(boolean background)
          Get Color for Status
 String getDescription()
          Get Description
 Timestamp getEndTime()
          Get End time
 String getInfo()
          Get Info with Date, Time From-To Name Description
 String getInfoDateTimeFromTo()
          Get Info with Date & Time From-To
 String getInfoNameDescription()
          Get Info with Name and optional Description
 String getInfoTimeFrom()
          Get Info with Time From
 String getInfoTimeFromTo()
          Get Info with Time From-To
 MResourceAssignment getMAssignment()
          Get Assugnment
 String getName()
          Get Name
 Timestamp getStartTime()
          Get Start time
 int getStatus()
          Get Status
 int getXMax()
          Get X columns
 int getXPos()
          Get X position
 int getYEnd()
          Get Y end position
 int getYStart()
          Get Y start position
 int hashCode()
          HashCode of MAssignmentSlot
 boolean inSlot(Timestamp time, boolean endTime)
          Returns true if time is between start and end Time.
 boolean isAssignment()
          Is the Slot an Assignment?
 void setDescription(String description)
          Set Description
 void setDisplay(int displayMode)
          Set Display Mode of toString()
 void setEndTime(Timestamp endTime)
          Set End time
 void setLanguage(Language language)
          Set Language
 void setMAssignment(MResourceAssignment assignment)
          Set Assignment
 void setName(String name)
          Set Name
 void setStartTime(Timestamp startTime)
          Set Start time
 void setStatus(int status)
          Set Status
 void setX(int xPos, int xMax)
          Set X position
 void setY(int yStart, int yEnd)
          Set Y position
 String toString()
          String representation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_NotAvailable

public static final int STATUS_NotAvailable
Not Available Code

See Also:
Constant Field Values

STATUS_UnAvailable

public static final int STATUS_UnAvailable
Not Available Code

See Also:
Constant Field Values

STATUS_NonBusinessDay

public static final int STATUS_NonBusinessDay
Not Available Code

See Also:
Constant Field Values

STATUS_NotInSlotDay

public static final int STATUS_NotInSlotDay
Not Available Code

See Also:
Constant Field Values

STATUS_NotInSlotTime

public static final int STATUS_NotInSlotTime
Not Available Code

See Also:
Constant Field Values

STATUS_NotConfirmed

public static final int STATUS_NotConfirmed
Assignment Code

See Also:
Constant Field Values

STATUS_Confirmed

public static final int STATUS_Confirmed
Assignment Code

See Also:
Constant Field Values

STATUS_TimeSlot

public static final int STATUS_TimeSlot
Assignment Code

See Also:
Constant Field Values

DISPLAY_ALL

public static final int DISPLAY_ALL
toString displays everything

See Also:
Constant Field Values

DISPLAY_TIME_FROM

public static final int DISPLAY_TIME_FROM
toString displays formatted time from

See Also:
Constant Field Values

DISPLAY_TIME_FROM_TO

public static final int DISPLAY_TIME_FROM_TO
toString displays formatted time from-to

See Also:
Constant Field Values

DISPLAY_DATETIME_FROM_TO

public static final int DISPLAY_DATETIME_FROM_TO
toString displays formatted day time from-to

See Also:
Constant Field Values

DISPLAY_NAME

public static final int DISPLAY_NAME
toString displays name

See Also:
Constant Field Values

DISPLAY_NAME_DESCRIPTION

public static final int DISPLAY_NAME_DESCRIPTION
toString displays name and optional description

See Also:
Constant Field Values

DISPLAY_FULL

public static final int DISPLAY_FULL
toString displays formatted all info

See Also:
Constant Field Values
Constructor Detail

MAssignmentSlot

public MAssignmentSlot()
Comparator Constructor


MAssignmentSlot

public MAssignmentSlot(Timestamp startTime,
                       Timestamp endTime)
Timeslot Constructor

Parameters:
startTime - start time
endTime - end time

MAssignmentSlot

public MAssignmentSlot(long startTime,
                       long endTime)
Timeslot Constructor

Parameters:
startTime - start time
endTime - end time

MAssignmentSlot

public MAssignmentSlot(Timestamp startTime,
                       Timestamp endTime,
                       String name,
                       String description,
                       int status)
Non Assignment Constructor

Parameters:
startTime - start time
endTime - end time
name - name
description - description
status - status

MAssignmentSlot

public MAssignmentSlot(MResourceAssignment assignment)
Assignment Constructor

Parameters:
assignment - MAssignment
Method Detail

setStatus

public void setStatus(int status)
Set Status

Parameters:
status - STATUS_..

getStatus

public int getStatus()
Get Status

Returns:
STATUS_..

isAssignment

public boolean isAssignment()
Is the Slot an Assignment?

Returns:
true if slot is an assignment

getColor

public Color getColor(boolean background)
Get Color for Status

Parameters:
background - true if background - or foreground
Returns:
Color

getStartTime

public Timestamp getStartTime()
Get Start time

Returns:
start time

setStartTime

public void setStartTime(Timestamp startTime)
Set Start time

Parameters:
startTime - start time, if null use current time

getEndTime

public Timestamp getEndTime()
Get End time

Returns:
end time

setEndTime

public void setEndTime(Timestamp endTime)
Set End time

Parameters:
endTime - end time, if null use start time

setMAssignment

public void setMAssignment(MResourceAssignment assignment)
Set Assignment

Parameters:
assignment - MAssignment

getMAssignment

public MResourceAssignment getMAssignment()
Get Assugnment

Returns:
assignment

setName

public void setName(String name)
Set Name

Parameters:
name - name

getName

public String getName()
Get Name

Returns:
name

setDescription

public void setDescription(String description)
Set Description

Parameters:
description - description

getDescription

public String getDescription()
Get Description

Returns:
description

setY

public void setY(int yStart,
                 int yEnd)
Set Y position

Parameters:
yStart - zero based Y start index
yEnd - 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 index
xMax - number of parallel columns

getXPos

public int getXPos()
Get X position

Returns:
zero based X position index

getXMax

public int getXMax()
Get X columns

Returns:
number of parallel columns

setLanguage

public void setLanguage(Language language)
Set Language

Parameters:
language - language

setDisplay

public void setDisplay(int displayMode)
Set Display Mode of toString()

Parameters:
displayMode - DISPLAY_

toString

public String toString()
String representation

Overrides:
toString in class Object
Returns:
info

getInfoTimeFrom

public String getInfoTimeFrom()
Get Info with Time From

Returns:
info 00:00

getInfoTimeFromTo

public String getInfoTimeFromTo()
Get Info with Time From-To

Returns:
info 00:00 - 01:00

getInfoDateTimeFromTo

public String getInfoDateTimeFromTo()
Get Info with Date & Time From-To

Returns:
info 12/12/01 00:00 - 01:00 or 12/12/01 00:00 - 12/13/01 01:00

getInfoNameDescription

public String getInfoNameDescription()
Get Info with Name and optional Description

Returns:
Name (Description)

getInfo

public String getInfo()
Get Info with Date, Time From-To Name Description

Returns:
12/12/01 00:00 - 01:00: Name (Description)

inSlot

public boolean inSlot(Timestamp time,
                      boolean endTime)
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 day
endTime - if true, the end time is included
Returns:
true if within slot

compareTo

public int compareTo(MAssignmentSlot slot)
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:
compareTo in interface Comparable<MAssignmentSlot>
Parameters:
obj - 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.

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this Comparator.

Overrides:
equals in class Object
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:
Object.equals(java.lang.Object), Object.hashCode()

hashCode

public int hashCode()
HashCode of MAssignmentSlot

Overrides:
hashCode in class Object
Returns:
has code

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.