concept.structure
Class Session

public class Session

Title: Session-class

Description: Session-class that contains all the attributes and methods affecting sessions directly

Copyright: Copyright (c) 2006
CONCEPT-lisenssi Tekijänoikeus (c) 2006, Pekka Kuuva, Tatu Repo, Pasi Saari, Anna Seppänen. Kaikki oikeudet pidätetään. Tämän ohjelmiston levittäminen ja käyttö lähdekoodina ja binäärinä, muutettuna tai muuttamattomana, on sallittu edellyttäen, että seuraavat ehdot täytetään: 1. OHJELMISTON LEVITTÄMINEN Lähdekoodikopioissa, dokumentaatiossa ja muussa ohjelmiston mukana tulevassa aineistossa on oltava tämä lisenssi kokonaisuudessaan. 1.2. VIENTIRAJOITUKSET Ohjelmistoa tai sen osia ei saa viedä Amerikan Yhdysvaltoihin ilman tekijöiden erillistä suostumusta. 2. OHJELMISTON KÄYTTÖ (EULA) 2.1 KÄYTTÖEHDOT Ohjelmiston käyttäjän tulee joskus suorittaa vähintään yksi seuraavista toimista: a) Tarjota omalla kustannuksellaan olut tasokkaassa ravintolassa, pubissa tai muussa vastaavassa anniskelua harjoittavassa liikkeessä kullekin tekijöistä, sekä ilmoittaa tästä tarjouksesta. b) Tarjota tekijöille omalla kustannuksellaan pääsy tapahtumaan, jonka yhteydessä sovellusta on käytetty, ja ilmoittaa tästä tarjouksesta tekijöille. Ilmoittamisella tarkoitetaan vähintään viikkoa ennen tarjouk- sen täytäntöönpanoa tekijöille lähetettyä sähköpostia, jossa ilmoitetaan ohjelmiston käyttäjän nimi ja yhteystiedot sekä tarjous ja sen ajankohta. Jos käyttöehdot eivät ole täyttyneet, ohjelmistoa ei saa käyttää. 2.1. TAKUU Tekijänoikeuden haltijat ja ohjelmiston kehittäjät tarjoavat tämän ohjelmiston "sellaisena kuin se on". Sovellukselle ei myönnetä minkäänlaista takuuta kaupallisesti hyväksyttävästä laadusta eikä sen taata soveltuvan mihinkään tarkoitukseen. 2.2. VASTUUNRAJOITUS Tekijänoikeuden haltija ja ohjelmiston kehittäjät eivät ole missään tilanteessa vastuussa suorista, epäsuorista, yleisistä, erityisistä, satunnaisista tai seurauksellisista vahingoista (sisältäen, muttei tyhjentävästi, korvaavan tuotteen tai palvelun hankinnan, käyttömahdollisuuden, tiedon tai voittojen menetykset, tai liiketoiminnan keskeytymisen), jotka aiheutuvat miten tahansa ja millä tahansa vahingonkorvausoikeudellisella perusteella mukaanlukien sopimusvastuu, ankara vastuu ja sopimuksen ulkoinen vastuu (huolimattomuus tai muu), vaikka kyseisten vahinkojen mahdollisuudesta olisi kerrottu.

Version:
1.0
Author:
TR
Method Detail

destroy

public void destroy()
This destruction method removes all links to and from any instances of this class

setStartAndEndTime

public boolean setStartAndEndTime(long start,
                                  long end)
This method checks the start and end times and sets them as attributes
Parameters:
start - long The given starting time
end - long The given ending time
Returns:
boolean Returns whether the set was successful.

setScheduleLink

public void setScheduleLink(concept.structure.Block link)
This method sets the block-link for any instances of this class and also sets the start and end times according to the given block.
Parameters:
link - Block The given block.

gatherRestrictions

public boolean gatherRestrictions()
This method clears the accumulated restrictions and gathers them again by polling all the elements linked from this session.
Returns:
boolean Returns true when done.

findConflictsWith

public java.util.Vector findConflictsWith(concept.structure.Hall hall)
This method finds conflicts with this session and the given hall using compareRestrictionsWithTime-method
Parameters:
hall - Hall The given hall
Returns:
Vector Returns a vector containing all the found conflicts.

findConflictsWith

public java.util.Vector findConflictsWith(concept.structure.Presenter presenter)
This method finds conflicts between this session and the given presenter using compareRestrictionsWithTime-method.
Parameters:
presenter - Presenter The given presenter.
Returns:
Vector Returns all conflicts found.

findConflictsWith

public java.util.Vector findConflictsWith(concept.structure.Presentation presentation)
This method finds conflicts between this session and the given presentation using compareRestrictionsWithTime-method.
Parameters:
presentation - Presentation The given presentation.
Returns:
Vector Returns all found conflicts.

findConflictsWith

public java.util.Vector findConflictsWith(concept.structure.Block block)
This method finds conflicts between this session and the given block using compareRestrictionsWithTime-method.
Parameters:
block - Block
Returns:
Vector

compareRestrictionsWithRestriction

public java.util.Vector compareRestrictionsWithRestriction(concept.structure.ScheduleRestriction restr)
This method compares all the restrictions associated with this session against the given restriction in search for conflicts.
Parameters:
restr - ScheduleRestriction The given restrictions.
Returns:
Vector returns the found conflicts.

compareRestrictionsWithTime

public java.util.Vector compareRestrictionsWithTime(long start,
                                                    long end)
This method compares all the restrictions associated with this session against a dummy-restriction created from the parameters.
Parameters:
start - long The starting time of the dummy-restriction.
end - long The ending time of the dummy-restriction.
Returns:
Vector Returns all found conflicts.

containsUnRegistered

public boolean containsUnRegistered()
This method returns whether this session is linked to any unregistered presenters.
Returns:
boolean Returns whether this session is linked to any unregistered presenters.

containsRestricted

public boolean containsRestricted()
This method returns whether this session is linked to any presentations or presenters with restrictions of their own.
Returns:
boolean Return whether this session is linked to any presentations or presenters with restrictions of their own.

insertPresentationAt

public void insertPresentationAt(concept.structure.Presentation presentation,
                                 int index)
Inserts a presentation to a given index within the session datastructure.
Parameters:
presentation - Presentation
index - int

removeRestrictionsByRcbs

public boolean removeRestrictionsByRcbs(concept.structure.Session session)
Removes all the restrictions caused by the given session from elements linked to this session.
Parameters:
session - Session The given session.
Returns:
boolean Returns true when done.

addLowerRestriction

public boolean addLowerRestriction(concept.structure.ScheduleRestriction restr)
Adds a restriction to the accumulatedrestrictions container.
Parameters:
restr - ScheduleRestriction The given restriction.
Returns:
boolean Returns whether the operation was successful.

addLowerRestrictionFromDB

public boolean addLowerRestrictionFromDB(concept.structure.ScheduleRestriction restr)
Adds a restriction to the accumulatedrestrictions container without invoking the setIsChanged-flag.
Parameters:
restr - ScheduleRestriction The given restriction.
Returns:
boolean Returns whether the operation was successful.

addChairman

public boolean addChairman(concept.structure.Presenter chairman,
                           int order)
Adds a chairman to this session with the given ordernumber.
Parameters:
chairman - Presenter The given chairman.
order - int The ordernumber of the chairman.
Returns:
boolean Returns whether the operation was successful.

addChairmanFromDB

public boolean addChairmanFromDB(concept.structure.Presenter presenter,
                                 int order)
Adds a chairman to this session with the given ordernumber. Handles also linking from the presenterside. This method is for the Jdbc-classes read-methods. Does not invoke the isChanged-flag.
Parameters:
presenter - Presenter The given presenter
order - int The given ordernumber.
Returns:
boolean returns whether the operation was successful.

removeChairman

public boolean removeChairman(concept.structure.Presenter presenter)
Removes the given chairman from this session.
Parameters:
presenter - Presenter the given chairman.
Returns:
boolean returns whether the operation was successful.

removeChairmanAt

public boolean removeChairmanAt(int index)
Removes the chairman at the given index.
Parameters:
index - int The given index.
Returns:
boolean Returns whether successful.

removeAllChairmen

public void removeAllChairmen()
Removes all chairmen from this session.

addPresentation

public boolean addPresentation(concept.structure.Presentation presentation)
Adds a presentation to this session.
Parameters:
presentation - Presentation The given presentation.
Returns:
boolean Returns whether the operation was successful.

addPresentationFromDB

public boolean addPresentationFromDB(concept.structure.Presentation presentation)
Adds a presentation to this session. Also handles the linking from the presentationside. This method is for the Jdbc-class read-methods.
Parameters:
presentation - Presentation The given presentation.
Returns:
boolean Returns whether the operation was successful.

removePresentation

public boolean removePresentation(concept.structure.Presentation presentation)
Removes the given presentation from this session.
Parameters:
presentation - Presentation The given presentation.
Returns:
boolean Returns whether the operation was successful.

removePresentationAt

public boolean removePresentationAt(int index)
Removes a presentation at the given index.
Parameters:
index - int The given index.
Returns:
boolean Returns whether the operation was successful.

isInvited

public boolean isInvited()
Returns whether this sessions sessiontype is invited.
Returns:
boolean Returns whether this sessions sessiontype is invited.

getDuration

public int getDuration()
A method that calculates the duration of the session by adding the durations of individual presentations in the sessions presentation-list. Not used.
Returns:
int returns the duration of the session as calculated by the method

isScheduled

public boolean isScheduled()
returns whether this session is scheduled.
Returns:
boolean returns whether this session is scheduled.