Пример #1
0
 /**
  * @param aLocationCode
  * @param aCountryID
  * @param aTableID
  * @param aDirectionIsReverse
  * @param aAnExtend
  * @param aEvent
  */
 private void addExtendedExtend(
     final int aLocationCode,
     final int aCountryID,
     final int aTableID,
     final boolean aDirectionIsReverse,
     final int aAnExtend,
     final TMCEvent aEvent) {
   LinkedList<LatLon> extendsLatLon = new LinkedList<LatLon>();
   long nextLocationCode = aLocationCode;
   String dir = ".next";
   if (aDirectionIsReverse) {
     dir = ".prev";
   }
   while (nextLocationCode != -1) {
     long temp = nextLocationCode;
     nextLocationCode = -1;
     try {
       String key = aCountryID + "." + aTableID + "." + temp + dir;
       nextLocationCode = Long.parseLong(myLocationLists.getString(key));
     } catch (Exception e) {
       LOG.fine(
           "Next location after "
               + aCountryID
               + "."
               + aTableID
               + "."
               + aLocationCode
               + " not in tmclocations.properties");
     }
     if (nextLocationCode == -1) {
       break;
     }
     try {
       Double lat =
           Double.parseDouble(
               myLocationLists.getString(
                   aCountryID + "." + aTableID + "." + nextLocationCode + ".lat"));
       Double lon =
           Double.parseDouble(
               myLocationLists.getString(
                   aCountryID + "." + aTableID + "." + nextLocationCode + ".lon"));
       extendsLatLon.add(new LatLon(lat, lon));
     } catch (Exception e) {
       LOG.fine(
           "Location "
               + aCountryID
               + "."
               + aTableID
               + "."
               + aLocationCode
               + " not in tmclocations.properties");
     }
   }
   aEvent.getExtendedProperties().put(TMCEvent.EXTPROPERTYEXTENDSTOLATLONS, extendsLatLon);
 }
Пример #2
0
 /**
  * @param aLocationCode
  * @param aCountryID
  * @param aTableID
  * @param event
  */
 private void addExtendedLocation(
     final int aLocationCode, final int aCountryID, final int aTableID, final TMCEvent event) {
   try {
     Double lat =
         Double.parseDouble(
             myLocationLists.getString(
                 aCountryID + "." + aTableID + "." + aLocationCode + ".lat"));
     Double lon =
         Double.parseDouble(
             myLocationLists.getString(
                 aCountryID + "." + aTableID + "." + aLocationCode + ".lon"));
     event.getExtendedProperties().put(TMCEvent.EXTPROPERTYLATLON, new LatLon(lat, lon));
   } catch (Exception e) {
     LOG.fine(
         "Location "
             + aCountryID
             + "."
             + aTableID
             + "."
             + aLocationCode
             + " not in tmclocations.properties");
   }
 }