Class ColorMap

All Implemented Interfaces:
Serializable, Cloneable, Map<String,List<ClientCollectionInfo>>

public class ColorMap extends HashMap<String,List<ClientCollectionInfo>>
This class allows us to apply a color to an event in a result set.

If the filter is null then a match on the path is sufficient. Otherwise an event must be passed through the filter to see if it matches.

We need this as queries to the server are an optimised and combined form of the paths and filters represented by aliases and real collections. The result is that without effectively replaying the defined filters any given event can be uassignable to a path and thence a color.

This is especially true of public events in the single calendar model where all events come from a single path and some categories are common to many of the virtual paths, e.g. Arts

Each entry is indexed by the path. If there is only one ClientCollectionInfo in the result then that color is applied. If there is more than one then the event must be matched to the filter.

Author:
Mike Douglass
See Also:
  • Constructor Details

    • ColorMap

      public ColorMap()
  • Method Details

    • put

      public void put(String path, ClientCollectionInfo cci)
      Either put a new entry or add to an existing path entry.
      Parameters:
      path -
      cci -
    • setColor

      public void setColor(EventInfo ei, String userHref)
      Attempt to set the color for the given event. If there is no appropriate mapping the event color will be set to null.
      Parameters:
      ei -
      userHref -
    • setColor

      public void setColor(Collection<EventInfo> eis, String userHref)
      Attempt to set the color for the given events. If there is no appropriate mapping the event color will be set to null.
      Parameters:
      eis -
      userHref -