class CommonAlgorithmsFromCartAGen {

  public static boolean areLinesSameDirection(ILineString line,
      ILineString subLine) {
    if (!line.contains(subLine))
      return false;
    IDirectPosition first = subLine.coord().get(0);
    IDirectPosition second = subLine.coord().get(1);
    int index1 = line.coord().getList().indexOf(first);
    int index2 = line.coord().getList().indexOf(second);
    if (index1 < index2)
      return true;
    return false;
  }

}