Package org.onebusaway.transit_data.model.service_alerts

Examples of org.onebusaway.transit_data.model.service_alerts.ESeverity


  private void handleOtherFields(PtSituationElementStructure ptSituation,
      ServiceAlert.Builder serviceAlert) {

    SeverityEnumeration severity = ptSituation.getSeverity();
    if (severity != null) {
      ESeverity severityEnum = ESeverity.valueOfTpegCode(severity.value());
      serviceAlert.setSeverity(ServiceAlertLibrary.convertSeverity(severityEnum));
    }

    if (ptSituation.getPublicationWindow() != null) {
      HalfOpenTimestampRangeStructure window = ptSituation.getPublicationWindow();
View Full Code Here


    bean.setSummary(getBestString(situation.getSummaries()));
    bean.setDescription(getBestString(situation.getDescriptions()));
    bean.setUrl(getBestString(situation.getUrls()));

    ESeverity severity = situation.getSeverity();
    if (severity != null) {
      String[] codes = severity.getTpegCodes();
      bean.setSeverity(codes[0]);
    }

    return bean;
  }
View Full Code Here

    }
    return unreadServiceAlertCount;
  }

  public String getUnreadServiceAlertsClass() {
    ESeverity severity = getHighestUnreadSeverity();
    if (severity == ESeverity.NO_IMPACT)
      return "unreadServiceAlertsNoImpactSeverity";
    return "unreadServiceAlertsNormalSeverity";
  }
View Full Code Here

    return (from <= _time && _time <= to);
  }

  private ESeverity getHighestUnreadSeverity() {

    ESeverity maxSeverity = null;

    Map<String, Long> readServiceAlerts = _user.getReadServiceAlerts();
    for (ServiceAlertBean situation : _situations) {

      if (isSituationUnread(readServiceAlerts, situation)) {
        ESeverity s = situation.getSeverity();
        if (s == null)
          s = ESeverity.UNDEFINED;
        if (maxSeverity == null
            || maxSeverity.getNumericValue() < s.getNumericValue())
          maxSeverity = s;
      }
    }
    return maxSeverity;
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.service_alerts.ESeverity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.