Class Zones

java.lang.Object
overit.geocall.util.Zones
All Implemented Interfaces:
Serializable

public class Zones extends Object implements Serializable
The class implements a list of time zones
See Also:
  • Field Details

  • Constructor Details

    • Zones

      @Deprecated public Zones(Teacher t)
      Deprecated.
      use Zones() instead
      Creates a new empty Zones instance
      Parameters:
      t - Not used
    • Zones

      public Zones()
      Creates a new empty Zones instance
  • Method Details

    • addZone

      public void addZone(String name, String label)
      Adds a new zone to the list of zones
      Parameters:
      name - The name of the zone
      label - The label used in visualization
    • getZoneLabel

      public String getZoneLabel(String name)
      Returns the label of the zone with the name that corresponds to the one passed as parameter
      Parameters:
      name - The name of the zone
      Returns:
      The corresponding label of the zone
    • isDefined

      public boolean isDefined(String name)
      Checks if the zone with the name passed as parameter is defined
      Parameters:
      name - The name of the zone
      Returns:
      true if the zone is defined (ie if the zone is present in the list of Zones), false otherwise
    • isEmptyOrDefault

      public boolean isEmptyOrDefault(TimeZone defaultZ)
    • isEmpty

      public boolean isEmpty()
    • getOptions

      public org.apache.ecs.html.Option[] getOptions()
      Returns the array of options that corresponds to the list of zones
      Returns:
      The array of options
    • getOptions

      public org.apache.ecs.html.Option[] getOptions(String selection, String clz, String selectionClz)
      Returns the array of options that corresponds to the list of zones
      Parameters:
      selection - The id of the selected zone
      clz - String that defines the css classes that will be applied to the options
      selectionClz - String that defines the css classes that will be applied to selected option
      Returns:
      The array of options
    • getIfAvailable

      public static TimeZone getIfAvailable(String name)
      Returns the TimeZone that corresponds to the name passed as parameter, if available
      Parameters:
      name - The name of the zone
      Returns:
      The corresponding TimeZone, or null
    • localDate

      public static Date localDate(TimeZone local)
      Transform the current server date as if it was the current date expressed i the local timezone
      Parameters:
      local - timezone in which the date will be expressed
      Returns:
      the shifted current server date
    • toCentral

      public static Date toCentral(Date localDate, TimeZone local)
      Transform the server date as if it was the date expressed i the local timezone
      Parameters:
      localDate - the date expressed in the local timezone
      local - timezone in which the local date is expressed
      Returns:
      the shifted local date
    • toLocal

      public static Date toLocal(Date centralDate, TimeZone local)
      Transform the server date as if it was the date expressed i the local timezone
      Parameters:
      centralDate - the date expressed in the server's timezone
      local - timezone in which the date will be expressed
      Returns:
      the shifted server date