uniform method order

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@663 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-05-27 16:04:39 +00:00
parent 56465ede5e
commit c9fac86b2a
58 changed files with 967 additions and 968 deletions

View file

@ -66,12 +66,6 @@ public class InvgProvider extends AbstractHafasProvider
return true;
return false;
}
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlMLcReq(constraint);
}
private static final String[] PLACES = { "Ingolstadt", "München" };
@ -108,45 +102,6 @@ public class InvgProvider extends AbstractHafasProvider
}
}
protected static final Pattern P_NORMALIZE_LINE_BUS = Pattern.compile("Bus\\s*(\\d+)");
protected static final Pattern P_NORMALIZE_LINE_NACHTBUS = Pattern.compile("Bus\\s*N\\s*(\\d+)");
protected static final Pattern P_NORMALIZE_LINE_BUS_S = Pattern.compile("Bus\\s*S\\s*(\\d+)");
protected static final Pattern P_NORMALIZE_LINE_BUS_X = Pattern.compile("Bus\\s*X\\s*(\\d+)");
@Override
protected String normalizeLine(final String type, final String line)
{
if ("1".equals(type))
{
final Matcher mBus = P_NORMALIZE_LINE_BUS.matcher(line);
if (mBus.matches())
return "B" + mBus.group(1);
final Matcher mNachtbus = P_NORMALIZE_LINE_NACHTBUS.matcher(line);
if (mNachtbus.matches())
return "BN" + mNachtbus.group(1);
final Matcher mBusS = P_NORMALIZE_LINE_BUS_S.matcher(line);
if (mBusS.matches())
return "BS" + mBusS.group(1);
final Matcher mBusX = P_NORMALIZE_LINE_BUS_X.matcher(line);
if (mBusX.matches())
return "BX" + mBusX.group(1);
}
return super.normalizeLine(type, line);
}
@Override
protected char normalizeType(final String type)
{
if ("1".equals(type))
return 'B';
return 0;
}
private String departuresQueryUri(final int stationId, final int maxDepartures)
{
final StringBuilder uri = new StringBuilder();
@ -307,6 +262,50 @@ public class InvgProvider extends AbstractHafasProvider
}
}
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlMLcReq(constraint);
}
protected static final Pattern P_NORMALIZE_LINE_BUS = Pattern.compile("Bus\\s*(\\d+)");
protected static final Pattern P_NORMALIZE_LINE_NACHTBUS = Pattern.compile("Bus\\s*N\\s*(\\d+)");
protected static final Pattern P_NORMALIZE_LINE_BUS_S = Pattern.compile("Bus\\s*S\\s*(\\d+)");
protected static final Pattern P_NORMALIZE_LINE_BUS_X = Pattern.compile("Bus\\s*X\\s*(\\d+)");
@Override
protected String normalizeLine(final String type, final String line)
{
if ("1".equals(type))
{
final Matcher mBus = P_NORMALIZE_LINE_BUS.matcher(line);
if (mBus.matches())
return "B" + mBus.group(1);
final Matcher mNachtbus = P_NORMALIZE_LINE_NACHTBUS.matcher(line);
if (mNachtbus.matches())
return "BN" + mNachtbus.group(1);
final Matcher mBusS = P_NORMALIZE_LINE_BUS_S.matcher(line);
if (mBusS.matches())
return "BS" + mBusS.group(1);
final Matcher mBusX = P_NORMALIZE_LINE_BUS_X.matcher(line);
if (mBusX.matches())
return "BX" + mBusX.group(1);
}
return super.normalizeLine(type, line);
}
@Override
protected char normalizeType(final String type)
{
if ("1".equals(type))
return 'B';
return 0;
}
private static final Map<String, int[]> LINES = new HashMap<String, int[]>();
static