concept
Class Intermediator

public class Intermediator
implements concept.DataStructure

Title: Intermediator-class

Description: This class offers service to the user-interface through the DataStructure-interface.

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, AS
Method Detail

getKeywords

public java.util.Vector getKeywords(concept.structure.Topic topic)
This method fetches all the keywords associated with the given topic
Parameters:
topic - Topic The given topic
Returns:
Vector Returns a vector containing the keywords assoiciated with the given topic

getAllSessions

public java.util.Vector getAllSessions()
Returns the session-vector of the main session container. This method is for testing purposes.
Returns:
Vector Returns the session-vector of the main session container.

getTopics

public java.util.Vector getTopics()
This method returns all the topics in the conference
Returns:
Vector returns all the topics in the conference

getBlockTypes

public java.util.Vector getBlockTypes()
This method returns all the blocktypes in the conference.
Returns:
Vector returns all the blocktypes in the conference.

getSessionAndPresentationTypes

public java.util.Vector getSessionAndPresentationTypes()
This methdo returns all the sessiontypes in the conference.
Returns:
Vector returns all the sessiontypes in the conference.

getDayCount

public int getDayCount()
This method counts the days in the conference.
Returns:
int returns the number of days in the conference.

getHalls

public java.util.Vector getHalls(int day)
This method returns the halls used in any given day of the conference.
Parameters:
day - int the day index
Returns:
Vector returns the halls associated

getAllHalls

public java.util.Vector getAllHalls()
Returns all halls associated with the conference.
Returns:
Vector returns a vector containing all halls associated with the conference.

getBlocks

public java.util.Vector getBlocks(int day)
Returns all blocks on a given day
Parameters:
day - int The index of the given day
Returns:
Vector Returns a vector containing all blocks on a given day

getSessions

public java.util.Vector getSessions(int day)
Returns all the sessions on a given day
Parameters:
day - int The given day index
Returns:
Vector Returns a vector containing all the sessions on the given day

addBlock

public concept.structure.Block addBlock(long start,
                                        long end,
                                        concept.structure.BlockType type)
Adds a new block to the schedule.
Parameters:
start - long The starting time of the block
end - long The ending time of the block
type - BlockType The type of the block
Returns:
Block Returns a block formed from the parameters

newSession

public concept.structure.Session newSession(java.lang.String abbrv,
                                            java.lang.String title,
                                            concept.structure.Topic topic,
                                            concept.structure.Type type,
                                            concept.structure.Presenter cman1,
                                            concept.structure.Presenter cman2)
Creates a new session with the given attributes.
Parameters:
abbrv - String Abbreviation of the session
title - String Title of the session
topic - Topic Topic of the session
type - Type Type of the session
cman1 - Presenter The first chairman of the session
cman2 - Presenter The second chairman of the session
Returns:
Session Returns the session created from the parameters

updateSessionData

public java.util.Vector updateSessionData(concept.structure.Session s,
                                          java.lang.String abbrv,
                                          java.lang.String title,
                                          concept.structure.Topic topic,
                                          concept.structure.Type type,
                                          concept.structure.Presenter cman1,
                                          concept.structure.Presenter cman2,
                                          boolean ready)
Updates changes from the parameter list into the given session.
Parameters:
s - Session The session to be updated.
abbrv - String Abbreviation of the session.
title - String Title of the session.
topic - Topic Topic of the session.
type - Type Type of the session.
cman1 - Presenter The first chairman of the session.
cman2 - Presenter The second chairman of the session.
ready - boolean The ready-flag of the session.
Returns:
Vector Returns the possible conflicts created by the update.

setChairman

public java.util.Vector setChairman(concept.structure.Session session,
                                    concept.structure.Presenter presenter,
                                    int orderNumber)
Sets the given chairman into the given session.
Parameters:
session - Session The given session
presenter - Presenter The given chairman
orderNumber - int The order number of the chairman in the session.
Returns:
Vector Returns the conflicts possibly created by this addition.

getChairmenByTopic

public java.util.Vector getChairmenByTopic(concept.structure.Topic topic)
Returns all the chairmen under a given topic.
Parameters:
topic - Topic The given topic.
Returns:
Vector Returns a vector containing all the chairmen under the given topic.

addPresentation

public java.util.Vector addPresentation(concept.structure.Session session,
                                        concept.structure.Presentation presentation)
Adds the given presentation to the given session.
Parameters:
session - Session The given session.
presentation - Presentation The given presentation.
Returns:
Vector Returns a vector containing the conflicts possibly created by this addition.

getDayBegin

public long getDayBegin(int index)
Returns the first millisecond of the day in the given index.
Parameters:
index - int The given index.
Returns:
long Returns the first millisecond of the day in the given index.

removePresentationFromSession

public boolean removePresentationFromSession(concept.structure.Session session,
                                             concept.structure.Presentation presentation)
Removes the given presentation from the given session.
Parameters:
session - Session The given session.
presentation - Presentation The given presentation.
Returns:
boolean Returns whether the operation was a success.

scheduleSession

public java.util.Vector scheduleSession(concept.structure.Session session,
                                        concept.structure.Hall hall,
                                        concept.structure.Block block)
Adds the given session to the given hall and block.
Parameters:
session - Session The given session.
hall - Hall The given hall.
block - Block The given block.
Returns:
Vector Returns the conflicts this addition possibly causes.

getRestrictions

public java.util.Vector getRestrictions(concept.structure.Presentation presentation)
Returns all the restrictions associated with the given presentation.
Parameters:
presentation - Presentation The given presentation.
Returns:
Vector Returns a vector containing all the restrictions associated with the given presentation.

swapSessions

public java.util.Vector swapSessions(concept.structure.Session session1,
                                     concept.structure.Session session2)
Swaps the given two sessions in the schedule.
Parameters:
session1 - Session A given session.
session2 - Session The other given session.
Returns:
Vector Returns a vector containing the conflicts possibly caused by the changes.

removeScheduleData

public boolean removeScheduleData(concept.structure.Session session)
Removes the given session from the schedule.
Parameters:
session - Session The given session.
Returns:
boolean Returns whether the operation was successful.

replacePresentationInSession

public java.util.Vector replacePresentationInSession(concept.structure.Presentation presentation,
                                                     int newPlacement)
Reassigns the given presentation to a new placement within its session.
Parameters:
presentation - Presentation The given presentation.
newPlacement - int The new placement.
Returns:
Vector Returns a vector that could contain conflicts. This return value has been added to accommodate future development.

removeBlock

public boolean removeBlock(concept.structure.Block block)
Removes and effectively destroys the given block.
Parameters:
block - Block The given block.
Returns:
boolean Returns whether the operation was successful.

removeHallFromDay

public boolean removeHallFromDay(concept.structure.Hall hall,
                                 long day)
Removes the given hall from the given day.
Parameters:
hall - Hall The given hall.
day - long The first millisecond of the given day.
Returns:
boolean Returns whether the operation was a success.

deleteSession

public boolean deleteSession(concept.structure.Session s)
Destroys the given session.
Parameters:
s - Session the given session.
Returns:
boolean Returns whether the operation was a success.

searchSessions

public java.util.Vector searchSessions(java.lang.String abbrv,
                                       java.lang.String title,
                                       concept.structure.Topic topic,
                                       concept.structure.Type type,
                                       concept.structure.Presenter cman,
                                       boolean isReady,
                                       boolean notReady,
                                       boolean hasRestrictions,
                                       boolean noRestrictions,
                                       boolean isScheduled,
                                       boolean notScheduled)
Searches sessions with the given parameters.
Parameters:
abbrv - String The abbreviation of the session.
title - String The title of the session.
topic - Topic The topic of the session.
type - Type The type of the session.
cman - Presenter The first chairman of the session.
isReady - boolean A boolean describing whether the session is ready.
notReady - boolean A boolean describing whether the session is not ready.
hasRestrictions - boolean A boolean describing whether the session has restrictions.
noRestrictions - boolean A boolean describing whether the session has no restrictions.
isScheduled - boolean A boolean describing whether the session is scheduled.
notScheduled - boolean A boolean describing whether the session is not scheduled.
Returns:
Vector Returns the searchresult in a vector.

searchPresentations

public java.util.Vector searchPresentations(java.lang.String title,
                                            concept.structure.Topic topic,
                                            concept.structure.Type type,
                                            java.lang.String presenter,
                                            java.lang.String keyword1,
                                            java.lang.String keyword2,
                                            java.lang.String keyword3,
                                            int grade,
                                            boolean isRegistered,
                                            boolean notRegistered,
                                            boolean isPlaced,
                                            boolean notPlaced,
                                            boolean hasRestrictions,
                                            boolean noRestrictions)
Searches presentations with the given parameters.
Parameters:
title - String The title of the presentation.
topic - Topic The topic of the presentation.
type - Type The type of the presentation.
presenter - String The first presenter of the presentation.
keyword1 - String The first keyword of the presentation.
keyword2 - String The second keyword of the presentation.
keyword3 - String The third keyword of the presentation.
grade - int The grade of the presentation.
isRegistered - boolean A boolean describing whether the first presenter of the presentation is registered.
notRegistered - boolean A boolean describing whether the first presenter of the presentation is not registered.
isPlaced - boolean A boolean describing whether the presentation is placed in the schedule.
notPlaced - boolean A boolean describing whether the presentation is placed in the schedule.
hasRestrictions - boolean A boolean describing whether the presentation has any accumulated or distinctive restrictions.
noRestrictions - boolean A boolean describing whether the presentation has no accumulated or distinctive restrictions.
Returns:
Vector Returns the searchresults in a vector.

addHallToDay

public boolean addHallToDay(concept.structure.Hall hall,
                            long day)
Adds the given hall to the given day.
Parameters:
hall - Hall The given hall.
day - long The first millisecond of the given day.
Returns:
boolean Returns whether the operation was a success.

updateBlock

public java.util.Vector updateBlock(concept.structure.Block block,
                                    long begin,
                                    long end,
                                    concept.structure.BlockType type)
Updates the given block with the parameters.
Parameters:
block - Block The given block.
begin - long The given starttime in milliseconds.
end - long The given endtime in milliseconds.
type - BlockType The given type.
Returns:
Vector Returns the vector containing all the conflicts possibly caused by the update.

detectAllConflicts

public java.util.Vector detectAllConflicts()
Checks the entire system of scheduled components for conflicts.
Returns:
Vector Returns a vector containing the found conflicts.