<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">you can do so too:<br>
new YourFlagEncoder("speedFactor=5.0|speedBits=5|turnCosts=true")<br>
<br>
or use the normal java way:<br>
new YourFlagEncoder(5, 5, 1)<br>
<br>
Regards,<br>
Peter<br>
<br>
On 28.05.2015 21:11, John Zhao wrote:<br>
</div>
<blockquote
cite="mid:CA+EBg9RC2TJZGxYjku2uA+5LBUrsXp0qtYVu4DP0meK8eGrAbg@mail.gmail.com"
type="cite">
<div dir="ltr">Thanks Peter for your answer.
<div><br>
</div>
<div>I mean "combne" is if I have something inside properties
like:</div>
<div>graph.flagEncoders=xxxcar|speedFactor=5.0|speedBits=5|turnCosts=true,
bike, mtb, foot<br>
</div>
<div><br>
</div>
<div>I want to it can be parsed by the program without hard
code.</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature"><b>Best Regards,</b>
<div><b>ZhiQiang ZHAO</b></div>
</div>
</div>
<br>
<div class="gmail_quote">On Thu, May 28, 2015 at 12:01 PM, Peter
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:graphhopper@gmx.de" target="_blank">graphhopper@gmx.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi,<br>
<br>
I'm not sure what you mean with 'combine'. You can mix
Java API and read from config too e.g. via<br>
<br>
graphHopper.init(CmdArgs.readFromConfig(..))<br>
graphHopper.setEncodingManager(new YourFlagEncoder(),
new CarFlagEncoder(), ...)<span class=""><br>
<br>
> Could you elaborate a little bit more about the
portability reason? I am new to reflection.<br>
<br>
</span> It is just that we want to support JavaScript
(TeaVM) and iOS, and for them we need to avoid some
stuff.<br>
<br>
Kind Regards,<br>
Peter<span class=""><br>
<br>
On 28.05.2015 20:49, John Zhao wrote:<br>
</span></div>
<span class="">
<blockquote type="cite">
<div dir="ltr">Hi Peter,
<div><br>
</div>
<div>I want to keep the compatibility of combine the
existing flagEncoder with my customized
flagEncoder.</div>
<div>And intialize them from the properties file.</div>
<div><br>
</div>
<div>Could you elaborate a little bit more about the
portability reason?</div>
<div>I am new to reflection.</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div><b>Best Regards,</b>
<div><b>ZhiQiang ZHAO</b></div>
</div>
</div>
<br>
<div class="gmail_quote">On Thu, May 28, 2015 at
11:44 AM, Peter <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:graphhopper@gmx.de"
target="_blank">graphhopper@gmx.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0
0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi John,<br>
<br>
if you have a custom flagencoder why not
just call<br>
new EncodingManager(new YourFlagEncoder()) ?<br>
<br>
Reflections was abandoned due to portability
reasons but also it is not really necessary
here, especially as you use it as a library
and you have a custom flag encoder anyway.<br>
<br>
Regards,<br>
Peter
<div>
<div><br>
<br>
On 28.05.2015 20:14, John Zhao wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have a project which use GH as
a library.</div>
<div>I have implemented my own flag
encoder, like xxxFlagEncoder.</div>
<div>I don't figure out a good way to
initialize it, except to change the
EncodingManger to insert
xxxFlagEncoder on
parseEncoderString().</div>
<div>I think it's better the change
the way EncodingManger initialize
all the flagEncoders.</div>
<div>EncodingManger can use reflection
to find the class or flagEncoder
from its name, if we standardize the
name and toString method.</div>
<div><br>
</div>
<div>Do you think it's a good idea, or
there is a better way? </div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</span></div>
<br>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>