com.knowgate.addrbook
Class DayPlan

java.lang.Object
  extended bycom.knowgate.addrbook.DayPlan

public class DayPlan
extends java.lang.Object

A bidimensional array with daily scheduled meeting in quarters of an hour.

Version:
1.0

Constructor Summary
DayPlan()
           
 
Method Summary
 int concurrentMeetings(int slice)
          Get count of concurrent meetings at a given slice
 Meeting getMeeting(int slice, int slot)
          Get meeting information
 void load(JDCConnection oConn, java.lang.String sFellowId, java.util.Date dtToday)
          Load scheduled meetings for a given Fellow.
 Meeting seekMeeting(java.lang.String sMeeting)
          Lookup a meeting given its unique identifier
 int sliceCount()
          Slice count per day.
 int slotsPerSlice()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DayPlan

public DayPlan()
Method Detail

load

public void load(JDCConnection oConn,
                 java.lang.String sFellowId,
                 java.util.Date dtToday)
          throws java.sql.SQLException

Load scheduled meetings for a given Fellow.

Parameters:
oConn - Database Connection
sFellowId - Fellow Unique Identifier
dtToday - Date for witch meeting are to be retrieved
Throws:
java.sql.SQLException
See Also:
{@link Fellow}

sliceCount

public int sliceCount()

Slice count per day.

96 is the default and equals a day divided in 15 minutes slices

Returns:
Maximum number of slices per day

slotsPerSlice

public int slotsPerSlice()
Returns:
Maximum number of allowed concurrent meetings per day slice

concurrentMeetings

public int concurrentMeetings(int slice)
                       throws java.lang.ArrayIndexOutOfBoundsException

Get count of concurrent meetings at a given slice

Parameters:
slice - [0...sliceCount()-1]
Throws:
java.lang.ArrayIndexOutOfBoundsException - If slice<0 or slice>=sliceCount()

getMeeting

public Meeting getMeeting(int slice,
                          int slot)
                   throws java.lang.ArrayIndexOutOfBoundsException

Get meeting information

Each meeting is asoociated with one or more day slices by having a list at the slice that point to every meeting taking place on the slice.

Thus for retriving a meeting both the slice number and the relative ordinal position of the meeting at the slice are needed.

Parameters:
slice - [0...sliceCount()-1]
slot - [0...slotsPerSlice()-1]
Returns:
Meeting or null if no meeting was found at the given (slice,slot) pair.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If slice<0 or slice>=sliceCount() or slot<0 or slot>=slotsPerSlice()

seekMeeting

public Meeting seekMeeting(java.lang.String sMeeting)

Lookup a meeting given its unique identifier

Parameters:
sMeeting - Meeting Unique Identifier
Returns:
Meeting or null if no meeting was found with given identifier.