net.sf.cpsolver.coursett.model

## Class TimeLocation

- java.lang.Object
- - net.sf.cpsolver.coursett.model.TimeLocation

-     public class TimeLocation
      extends Object

  Time part of placement.
  Version:
    CourseTT 1.2 (University Course Timetabling)
    Copyright (C) 2006 - 2010 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `TimeLocation.IntEnumeration`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeLocation(int dayCode, int startTime, int length, int pref, double normPref, int datePatternPreference, Long datePatternId, String datePatternName, BitSet weekCode, int breakTime)` Constructor
    `TimeLocation(int dayCode, int startTime, int length, int pref, double normPref, Long datePatternId, String datePatternName, BitSet weekCode, int breakTime)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `getBreakTime()`
    `Long` | `getDatePatternId()`
    `String` | `getDatePatternName()`
    `int` | `getDatePatternPreference()`
    `int` | `getDayCode()` Days (combination of 1 for Monday, 2 for Tuesday, ...)
    `String` | `getDayHeader()` Days for printing purposes
    `TimeLocation.IntEnumeration` | `getDays()` Days
    `int[]` | `getDaysArray()`
    `String` | `getEndTimeHeader()` End time for printing purposes
    `String` | `getEndTimeHeaderNoAdj()` End time for printing purposes
    `int` | `getFirstMeeting(int dayOfWeekOffset)`
    `int` | `getLength()` Length
    `String` | `getLongName()`
    `String` | `getLongNameNoAdj()`
    `String` | `getName()` Text representation
    `double` | `getNormalizedPreference()` Normalized preference
    `int` | `getNrMeetings()` Number of meetings
    `int` | `getNrSlotsPerMeeting()` Length
    `int` | `getNrWeeks()`
    `int` | `getNrWeeks(int startDay, int endDay)`
    `int` | `getPreference()` Preference
    `TimeLocation.IntEnumeration` | `getSlots()` Used slots
    `int` | `getStartSlot()` Start slot
    `TimeLocation.IntEnumeration` | `getStartSlots()` Used start slots (for each meeting)
    `String` | `getStartTimeHeader()` Start time for printing purposes
    `Long` | `getTimePatternId()` Time pattern model (can be null)
    `BitSet` | `getWeekCode()`
    `boolean` | `hasDay(int day)`
    `int` | `hashCode()`
    `boolean` | `hasIntersection(TimeLocation anotherLocation)` true if overlap
    `int` | `nrSharedDays(TimeLocation anotherLocation)` number of overlapping days
    `int` | `nrSharedHours(TimeLocation anotherLocation)` number of overlapping time slots (ignoring days)
    `void` | `setBreakTime(int breakTime)`
    `void` | `setDatePattern(Long datePatternId, String datePatternName, BitSet weekCode)`
    `void` | `setNormalizedPreference(double normalizedPreference)`
    `void` | `setPreference(int preference)`
    `void` | `setTimePatternId(Long timePatternId)`
    `boolean` | `shareDays(TimeLocation anotherLocation)` true if days overlap
    `boolean` | `shareHours(TimeLocation anotherLocation)` true if hours overlap
    `boolean` | `shareWeeks(BitSet weekCode)` true if weeks overlap
    `boolean` | `shareWeeks(TimeLocation anotherLocation)` true if weeks overlap
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TimeLocation

          public TimeLocation(int dayCode,
                              int startTime,
                              int length,
                              int pref,
                              double normPref,
                              int datePatternPreference,
                              Long datePatternId,
                              String datePatternName,
                              BitSet weekCode,
                              int breakTime)

      Constructor
      Parameters:
        `dayCode` - days (combination of 1 for Monday, 2 for Tuesday, ...)
        `startTime` - start slot
        `length` - number of slots
        `pref` - time preference

    - #### TimeLocation

          public TimeLocation(int dayCode,
                              int startTime,
                              int length,
                              int pref,
                              double normPref,
                              Long datePatternId,
                              String datePatternName,
                              BitSet weekCode,
                              int breakTime)

  - ### Method Detail

    - #### getNrMeetings

          public int getNrMeetings()

      Number of meetings

    - #### getBreakTime

          public int getBreakTime()

    - #### setBreakTime

          public void setBreakTime(int breakTime)

    - #### getDayCode

          public int getDayCode()

      Days (combination of 1 for Monday, 2 for Tuesday, ...)

    - #### getDayHeader

          public String getDayHeader()

      Days for printing purposes

    - #### getStartTimeHeader

          public String getStartTimeHeader()

      Start time for printing purposes

    - #### getEndTimeHeader

          public String getEndTimeHeader()

      End time for printing purposes

    - #### getEndTimeHeaderNoAdj

          public String getEndTimeHeaderNoAdj()

      End time for printing purposes

    - #### getStartSlot

          public int getStartSlot()

      Start slot

    - #### shareDays

          public boolean shareDays(TimeLocation anotherLocation)

      true if days overlap

    - #### nrSharedDays

          public int nrSharedDays(TimeLocation anotherLocation)

      number of overlapping days

    - #### shareHours

          public boolean shareHours(TimeLocation anotherLocation)

      true if hours overlap

    - #### nrSharedHours

          public int nrSharedHours(TimeLocation anotherLocation)

      number of overlapping time slots (ignoring days)

    - #### shareWeeks

          public boolean shareWeeks(TimeLocation anotherLocation)

      true if weeks overlap

    - #### shareWeeks

          public boolean shareWeeks(BitSet weekCode)

      true if weeks overlap

    - #### hasDay

          public boolean hasDay(int day)

    - #### hasIntersection

          public boolean hasIntersection(TimeLocation anotherLocation)

      true if overlap

    - #### getSlots

          public TimeLocation.IntEnumeration getSlots()

      Used slots

    - #### getStartSlots

          public TimeLocation.IntEnumeration getStartSlots()

      Used start slots (for each meeting)

    - #### getDays

          public TimeLocation.IntEnumeration getDays()

      Days

    - #### getDaysArray

          public int[] getDaysArray()

    - #### getName

          public String getName()

      Text representation

    - #### getLongName

          public String getLongName()

    - #### getLongNameNoAdj

          public String getLongNameNoAdj()

    - #### getPreference

          public int getPreference()

      Preference

    - #### setPreference

          public void setPreference(int preference)

    - #### getLength

          public int getLength()

      Length

    - #### getNrSlotsPerMeeting

          public int getNrSlotsPerMeeting()

      Length

    - #### getNormalizedPreference

          public double getNormalizedPreference()

      Normalized preference

    - #### setNormalizedPreference

          public void setNormalizedPreference(double normalizedPreference)

    - #### getTimePatternId

          public Long getTimePatternId()

      Time pattern model (can be null)

    - #### getDatePatternId

          public Long getDatePatternId()

    - #### setTimePatternId

          public void setTimePatternId(Long timePatternId)

    - #### getWeekCode

          public BitSet getWeekCode()

    - #### getDatePatternName

          public String getDatePatternName()

    - #### setDatePattern

          public void setDatePattern(Long datePatternId,
                                     String datePatternName,
                                     BitSet weekCode)

    - #### getDatePatternPreference

          public int getDatePatternPreference()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### getNrWeeks

          public int getNrWeeks()

    - #### getNrWeeks

          public int getNrWeeks(int startDay,
                                int endDay)

    - #### getFirstMeeting

          public int getFirstMeeting(int dayOfWeekOffset)