com.graphhopper.util.Helper.getLocale()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中com.graphhopper.util.Helper.getLocale()方法的一些代码示例,展示了Helper.getLocale()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.getLocale()方法的具体详情如下:
包路径:com.graphhopper.util.Helper
类名称:Helper
方法名:getLocale

Helper.getLocale介绍

暂无

代码示例

代码示例来源:origin: graphhopper/graphhopper

  1. public GHRequest setLocale(String localeStr) {
  2. return setLocale(Helper.getLocale(localeStr));
  3. }

代码示例来源:origin: graphhopper/graphhopper

  1. /**
  2. * This loads the translation files from the specified folder.
  3. */
  4. public TranslationMap doImport(File folder) {
  5. try {
  6. for (String locale : LOCALES) {
  7. TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
  8. trMap.doImport(new FileInputStream(new File(folder, locale + ".txt")));
  9. add(trMap);
  10. }
  11. postImportHook();
  12. return this;
  13. } catch (Exception ex) {
  14. throw new RuntimeException(ex);
  15. }
  16. }

代码示例来源:origin: graphhopper/graphhopper

  1. /**
  2. * This loads the translation files from classpath.
  3. */
  4. public TranslationMap doImport() {
  5. try {
  6. for (String locale : LOCALES) {
  7. TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
  8. trMap.doImport(TranslationMap.class.getResourceAsStream(locale + ".txt"));
  9. add(trMap);
  10. }
  11. postImportHook();
  12. return this;
  13. } catch (Exception ex) {
  14. throw new RuntimeException(ex);
  15. }
  16. }

代码示例来源:origin: com.rgi-corp/graphhopper

  1. public GHRequest setLocale(String localeStr) {
  2. return setLocale(Helper.getLocale(localeStr));
  3. }

代码示例来源:origin: com.graphhopper/graphhopper-api

  1. public GHRequest setLocale(String localeStr) {
  2. return setLocale(Helper.getLocale(localeStr));
  3. }

代码示例来源:origin: com.graphhopper/graphhopper

  1. public GHRequest setLocale( String localeStr )
  2. {
  3. return setLocale(Helper.getLocale(localeStr));
  4. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. /**
  2. * This loads the translation files from the specified folder.
  3. */
  4. public TranslationMap doImport(File folder) {
  5. try {
  6. for (String locale : LOCALES) {
  7. TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
  8. trMap.doImport(new FileInputStream(new File(folder, locale + ".txt")));
  9. add(trMap);
  10. }
  11. postImportHook();
  12. return this;
  13. } catch (Exception ex) {
  14. throw new RuntimeException(ex);
  15. }
  16. }

代码示例来源:origin: com.rgi-corp/graphhopper

  1. /**
  2. * This loads the translation files from the specified folder.
  3. */
  4. public TranslationMap doImport(File folder) {
  5. try {
  6. for (String locale : LOCALES) {
  7. TranslationHashMap trMap = new TranslationHashMap(Helper.getLocale(locale));
  8. trMap.doImport(new FileInputStream(new File(folder, locale + ".txt")));
  9. add(trMap);
  10. }
  11. postImportHook();
  12. return this;
  13. } catch (Exception ex) {
  14. throw new RuntimeException(ex);
  15. }
  16. }

代码示例来源:origin: com.graphhopper/graphhopper

  1. /**
  2. * This loads the translation files from the specified folder.
  3. */
  4. public TranslationMap doImport( File folder )
  5. {
  6. try
  7. {
  8. for (String locale : LOCALES)
  9. {
  10. TranslationHashMap trMap = new TranslationHashMap(Helper.getLocale(locale));
  11. trMap.doImport(new FileInputStream(new File(folder, locale + ".txt")));
  12. add(trMap);
  13. }
  14. postImportHook();
  15. return this;
  16. } catch (Exception ex)
  17. {
  18. throw new RuntimeException(ex);
  19. }
  20. }

代码示例来源:origin: com.rgi-corp/graphhopper

  1. /**
  2. * This loads the translation files from classpath.
  3. */
  4. public TranslationMap doImport() {
  5. try {
  6. for (String locale : LOCALES) {
  7. TranslationHashMap trMap = new TranslationHashMap(Helper.getLocale(locale));
  8. trMap.doImport(TranslationMap.class.getResourceAsStream(locale + ".txt"));
  9. add(trMap);
  10. }
  11. postImportHook();
  12. return this;
  13. } catch (Exception ex) {
  14. throw new RuntimeException(ex);
  15. }
  16. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. /**
  2. * This loads the translation files from classpath.
  3. */
  4. public TranslationMap doImport() {
  5. try {
  6. for (String locale : LOCALES) {
  7. TranslationHashMap trMap = new TranslationHashMap(getLocale(locale));
  8. trMap.doImport(TranslationMap.class.getResourceAsStream(locale + ".txt"));
  9. add(trMap);
  10. }
  11. postImportHook();
  12. return this;
  13. } catch (Exception ex) {
  14. throw new RuntimeException(ex);
  15. }
  16. }

代码示例来源:origin: com.graphhopper/graphhopper

  1. /**
  2. * This loads the translation files from classpath.
  3. */
  4. public TranslationMap doImport()
  5. {
  6. try
  7. {
  8. for (String locale : LOCALES)
  9. {
  10. TranslationHashMap trMap = new TranslationHashMap(Helper.getLocale(locale));
  11. trMap.doImport(TranslationMap.class.getResourceAsStream(locale + ".txt"));
  12. add(trMap);
  13. }
  14. postImportHook();
  15. return this;
  16. } catch (Exception ex)
  17. {
  18. throw new RuntimeException(ex);
  19. }
  20. }

代码示例来源:origin: graphhopper/map-matching

  1. build();
  2. } else {
  3. Translation tr = trMap.getWithFallBack(Helper.getLocale(localeStr));
  4. DouglasPeucker peucker = new DouglasPeucker().setMaxDistance(minPathPrecision);
  5. PathMerger pathMerger = new PathMerger().

代码示例来源:origin: graphhopper/map-matching

  1. StopWatch matchSW = new StopWatch();
  2. Translation tr = new TranslationMap().doImport().getWithFallBack(Helper.getLocale(args.getString("instructions")));
  3. final boolean withRoute = !args.getString("instructions").isEmpty();
  4. XmlMapper xmlMapper = new XmlMapper();

相关文章