Cisco Systems, Inc.

com.pcube.apps.engage.policy
Class TimeSlotMatrix

java.lang.Object
  extended by com.pcube.apps.engage.common.ArrayElement
      extended by com.pcube.apps.engage.common.UsableArrayElement
          extended by com.pcube.apps.engage.policy.TimeSlotMatrix
All Implemented Interfaces:
Formattable, java.io.Serializable, java.lang.Cloneable

public class TimeSlotMatrix
extends UsableArrayElement
implements java.io.Serializable, java.lang.Cloneable, Formattable

TimeSlotMatrix devides the week into 24 X 7 TimeFrames, represening the hours in a week. For each TimeFrame each Package can define a specific Rule per Service.

See Also:
Serialized Form

Field Summary
static int COLUMNS
           
static int ROWS
           
 
Constructor Summary
TimeSlotMatrix(Policy policy)
           
 
Method Summary
 java.lang.Object clone()
           
 void fromStream(java.io.BufferedReader in, Formatter f)
          parse from stream using the default element tag name
 java.lang.String getName()
           
 Policy getPolicy()
           
 TimeFrame getTimeFrame(int day, int hour, int minutes)
          Gets the TimeFrame defined for a certain moment in the week.
 void setName(java.lang.String name)
           
 void setTimeSlot(int startDay, int startHour, int startMinutes, int endDay, int endHour, int endMinutes, TimeFrame frame)
          Sets the TimeFrame for a consecutive period of time.
 void toStream(java.io.PrintStream out, Formatter f)
          write to stream using default tag name
 java.lang.String toString()
           
 
Methods inherited from class com.pcube.apps.engage.common.UsableArrayElement
fromStream, isUsed, setUsed, toStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMNS

public static final int COLUMNS
See Also:
Constant Field Values

ROWS

public static final int ROWS
See Also:
Constant Field Values
Constructor Detail

TimeSlotMatrix

public TimeSlotMatrix(Policy policy)
Method Detail

clone

public java.lang.Object clone()
Specified by:
clone in class ArrayElement
See Also:
Object.clone()

fromStream

public void fromStream(java.io.BufferedReader in,
                       Formatter f)
                throws ImportExportException
Description copied from class: UsableArrayElement
parse from stream using the default element tag name

Specified by:
fromStream in interface Formattable
Overrides:
fromStream in class UsableArrayElement
Throws:
ImportExportException

getName

public java.lang.String getName()

getTimeFrame

public TimeFrame getTimeFrame(int day,
                              int hour,
                              int minutes)
Gets the TimeFrame defined for a certain moment in the week. The resolution is in hours, therefor, the minute input is not taken into account.

Parameters:
day - the desired time's day
hour - the desired time's hour
minutes - the desired time's minute (ignored)
Returns:
the TimeFrame defined for the queried time in the week

setName

public void setName(java.lang.String name)
             throws DuplicateItemException
Throws:
DuplicateItemException

setTimeSlot

public void setTimeSlot(int startDay,
                        int startHour,
                        int startMinutes,
                        int endDay,
                        int endHour,
                        int endMinutes,
                        TimeFrame frame)
Sets the TimeFrame for a consecutive period of time. The function gets the starting time and ending time of the period which gets the desired TimeFrame. The minutes which are given as input are not taken into account - the resolution is in hours. Future implementation might have a more refine resolution.

Parameters:
startDay - the starting day for the consecutive period
startHour - the starting hour for the consecutive period
startMinutes - the starting minute for the consecutive period (ignored)
endDay - the ending day for the consecutive period
endHour - the ending hour for the consecutive period
endMinutes - the ending minute for the consecutive period (ignored)
frame - the period's Timeframe

toStream

public void toStream(java.io.PrintStream out,
                     Formatter f)
Description copied from class: UsableArrayElement
write to stream using default tag name

Specified by:
toStream in interface Formattable
Overrides:
toStream in class UsableArrayElement

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getPolicy

public Policy getPolicy()

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.