edu.csus.ecs.pc2.api.listener

## Class ContestEvent

- java.lang.Object
- - edu.csus.ecs.pc2.api.listener.ContestEvent

-     public class ContestEvent
      extends Object

  This class describes an Event representing the situation that some piece of contest configuration information has changed.

  Each individual `ContestEvent` contains multiple fields which together act to describe the change which has occured. First, every `ContestEvent` contains an `ContestEvent.EventType` (an enum element) identifying the general category of event -- whether it is related to changes in Accounts, Languages, Problems, etc.

  Next, each `ContestEvent` contains detailed information which is event-type dependent. For example, events of type `ContestEvent.EventType.PROBLEM` (related to changes in contest problem configuration) contain an object of type `IProblem` describing the problem configuration change which has occurred.

  Clients implementing the PC2 API `IConfigurationUpdateListener` interface can determine the details of a contest configuration update event by first obtaining the `ContestEvent.EventType` from the received event, and subsequently using the appropriate `ContestEvent` methods to obtain the configuration change details.

  This documentation describes the current draft of the PC2 API, which is subject to change.

  Version:
    $Id: ContestEvent.java 1283 2008-02-12 08:30:41Z clevengr $
  Author:
    pc2@ecs.csus.edu
  See Also:
    `ContestEvent.EventType`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ContestEvent.EventType` This enum identifies the types of configuration change events which can occur.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContestEvent(ContestEvent.EventType eventType, IClient client)` Construct an event representing a change in a contest Client (account).
    `ContestEvent(ContestEvent.EventType eventType, IContestClock contestClock)` Construct an event representing a change in contest clock (time) information).
    `ContestEvent(ContestEvent.EventType eventType, IGroup group)` Construct an event representing a change in a contest Group.
    `ContestEvent(ContestEvent.EventType eventType, IJudgement judgement)` Construct an event representing a change in a contest Judgement.
    `ContestEvent(ContestEvent.EventType eventType, ILanguage language)` Construct an event representing a change in a contest Language.
    `ContestEvent(ContestEvent.EventType eventType, IProblem problem)` Construct an event representing a change in a contest Problem.
    `ContestEvent(ContestEvent.EventType eventType, ISite site)` Construct an event representing a change in a contest site.
    `ContestEvent(ContestEvent.EventType eventType, String contestTitle)` Construct an event representing a change in the contest title.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IClient` | `getClient()` Get the client associated with events of type `ContestEvent.EventType.CLIENT`.
    `IContestClock` | `getContestClock()` Get Contest Clock info associated with events of type `ContestEvent.EventType.CONTEST_CLOCK`.
    `String` | `getContestTitle()` Get the Contest Title associated with events of type `ContestEvent.EventType.CONTEST_TITLE`.
    `ContestEvent.EventType` | `getEventType()` Get the type of this event.
    `IGroup` | `getGroup()` Get the Group info associated with events of type `ContestEvent.EventType.GROUP`.
    `IJudgement` | `getJudgement()` Get the Judgement associated with events of type `ContestEvent.EventType.JUDGEMENT`.
    `ILanguage` | `getLanguage()` Get the Language info associated with events of type `ContestEvent.EventType.LANGUAGE`.
    `IProblem` | `getProblem()` Get the Problem info associated with events of type `ContestEvent.EventType.PROBLEM`.
    `ISite` | `getSite()` Get the `ISite` associated with events of type `ContestEvent.EventType.SITE`.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      ISite site)

      Construct an event representing a change in a contest site.
      Parameters:
        `eventType` -
        `site` - the contest site which has changed

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      String contestTitle)

      Construct an event representing a change in the contest title.
      Parameters:
        `eventType` -
        `contestTitle` - the new contest title

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      IGroup group)

      Construct an event representing a change in a contest Group.
      Parameters:
        `eventType` -
        `group` - the changed contest group

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      IClient client)

      Construct an event representing a change in a contest Client (account).
      Parameters:
        `eventType` -
        `client` - the changed contest client

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      IContestClock contestClock)

      Construct an event representing a change in contest clock (time) information).
      Parameters:
        `eventType` -
        `contestClock` - the changed contest clock

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      IJudgement judgement)

      Construct an event representing a change in a contest Judgement.
      Parameters:
        `eventType` -
        `judgement` - the changed Judgement

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      ILanguage language)

      Construct an event representing a change in a contest Language.
      Parameters:
        `eventType` -
        `language` - the changed contest language

    - #### ContestEvent

          public ContestEvent(ContestEvent.EventType eventType,
                      IProblem problem)

      Construct an event representing a change in a contest Problem.
      Parameters:
        `eventType` -
        `problem` - the changed contest problem

  - ### Method Detail

    - #### getClient

          public IClient getClient()

      Get the client associated with events of type `ContestEvent.EventType.CLIENT`.
      See Also:
        `getEventType()`

    - #### getContestClock

          public IContestClock getContestClock()

      Get Contest Clock info associated with events of type `ContestEvent.EventType.CONTEST_CLOCK`.
      See Also:
        `getEventType()`

    - #### getEventType

          public ContestEvent.EventType getEventType()

      Get the type of this event.
      Returns:
        the event type for this event.

    - #### getGroup

          public IGroup getGroup()

      Get the Group info associated with events of type `ContestEvent.EventType.GROUP`.
      See Also:
        `getEventType()`

    - #### getJudgement

          public IJudgement getJudgement()

      Get the Judgement associated with events of type `ContestEvent.EventType.JUDGEMENT`.
      See Also:
        `getEventType()`

    - #### getLanguage

          public ILanguage getLanguage()

      Get the Language info associated with events of type `ContestEvent.EventType.LANGUAGE`.
      See Also:
        `getEventType()`

    - #### getProblem

          public IProblem getProblem()

      Get the Problem info associated with events of type `ContestEvent.EventType.PROBLEM`.
      See Also:
        `getEventType()`

    - #### getContestTitle

          public String getContestTitle()

      Get the Contest Title associated with events of type `ContestEvent.EventType.CONTEST_TITLE`.
      Returns:
        contest title.

    - #### getSite

          public ISite getSite()

      Get the `ISite` associated with events of type `ContestEvent.EventType.SITE`.
      Returns:
        The site associated with this event.