当前位置: 首页>>代码示例>>Java>>正文


Java ShapePoint类代码示例

本文整理汇总了Java中org.onebusaway.gtfs.model.ShapePoint的典型用法代码示例。如果您正苦于以下问题:Java ShapePoint类的具体用法?Java ShapePoint怎么用?Java ShapePoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ShapePoint类属于org.onebusaway.gtfs.model包,在下文中一共展示了ShapePoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEntityClasses

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
public static List<Class<?>> getEntityClasses() {
  List<Class<?>> entityClasses = new ArrayList<Class<?>>();
  entityClasses.add(FeedInfo.class);
  entityClasses.add(Agency.class);
  entityClasses.add(Block.class);
  entityClasses.add(ShapePoint.class);
  entityClasses.add(Route.class);
  entityClasses.add(Stop.class);
  entityClasses.add(Trip.class);
  entityClasses.add(StopTime.class);
  entityClasses.add(ServiceCalendar.class);
  entityClasses.add(ServiceCalendarDate.class);
  entityClasses.add(FareAttribute.class);
  entityClasses.add(FareRule.class);
  entityClasses.add(Frequency.class);
  entityClasses.add(Pathway.class);
  entityClasses.add(Transfer.class);
  return entityClasses;
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:20,代码来源:GtfsEntitySchemaFactory.java

示例2: getEntityComparators

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
public static Map<Class<?>, Comparator<?>> getEntityComparators() {
  Map<Class<?>, Comparator<?>> comparators = new HashMap<Class<?>, Comparator<?>>();
  comparators.put(Agency.class,
      getComparatorForIdentityBeanType(Agency.class));
  comparators.put(Block.class,
      getComparatorForIdentityBeanType(Block.class));
  comparators.put(Route.class, getComparatorForIdentityBeanType(Route.class));
  comparators.put(Stop.class, getComparatorForIdentityBeanType(Stop.class));
  comparators.put(Trip.class, getComparatorForIdentityBeanType(Trip.class));
  comparators.put(StopTime.class, new StopTimeComparator());
  comparators.put(ShapePoint.class, new ShapePointComparator());
  comparators.put(ServiceCalendar.class, new ServiceCalendarComparator());
  comparators.put(ServiceCalendarDate.class,
      new ServiceCalendarDateComparator());
  return comparators;
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:17,代码来源:GtfsEntitySchemaFactory.java

示例3: getValueAt

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
    ShapePoint sp = shapePoints.get(rowIndex);
    
    Column column = Column.values()[columnIndex];
    
    switch (column) {
        case SHAPE_PT_SEQUENCE:
            return sp.getSequence();
        case SHAPE_PT_LAT:
            return sp.getLat();
        case SHAPE_PT_LON:
            return sp.getLon();
        case SHAPE_DIST_TRAVELED:
            return sp.isDistTraveledSet() ? sp.getDistTraveled() : null;
    }
    return null;
}
 
开发者ID:kurtraschke,项目名称:gtfsview,代码行数:19,代码来源:ShapePointsTableModel.java

示例4: GtfsReader

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
public GtfsReader() {

    _entityClasses.add(Agency.class);
    _entityClasses.add(Block.class);
    _entityClasses.add(ShapePoint.class);
    _entityClasses.add(Route.class);
    _entityClasses.add(Stop.class);
    _entityClasses.add(Trip.class);
    _entityClasses.add(StopTime.class);
    _entityClasses.add(ServiceCalendar.class);
    _entityClasses.add(ServiceCalendarDate.class);
    _entityClasses.add(FareAttribute.class);
    _entityClasses.add(FareRule.class);
    _entityClasses.add(Frequency.class);
    _entityClasses.add(Pathway.class);
    _entityClasses.add(Transfer.class);
    _entityClasses.add(FeedInfo.class);

    CsvTokenizerStrategy tokenizerStrategy = new CsvTokenizerStrategy();
    tokenizerStrategy.getCsvParser().setTrimInitialWhitespace(true);
    setTokenizerStrategy(tokenizerStrategy);
    
    setTrimValues(true);

    /**
     * Prep the Entity Schema Factories
     */
    DefaultEntitySchemaFactory schemaFactory = createEntitySchemaFactory();
    setEntitySchemaFactory(schemaFactory);

    CsvEntityContext ctx = getContext();
    ctx.put(KEY_CONTEXT, _context);

    addEntityHandler(new EntityHandlerImpl());
  }
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:36,代码来源:GtfsReader.java

示例5: getAllEntitiesForType

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T> Collection<T> getAllEntitiesForType(Class<T> type) {
  if (packStopTimes && type.equals(StopTime.class)) {
    return (Collection<T>) stopTimes;
  } else if (packShapePoints && type.equals(ShapePoint.class)) {
    return (Collection<T>) shapePoints;
  }
  return super.getAllEntitiesForType(type);
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:11,代码来源:GtfsDaoImpl.java

示例6: getEntityForId

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T> T getEntityForId(Class<T> type, Serializable id) {
  if (packStopTimes && type.equals(StopTime.class)) {
    return (T) stopTimes.get((Integer) id);
  } else if (packShapePoints && type.equals(ShapePoint.class)) {
    return (T) shapePoints.get((Integer) id);
  }
  return super.getEntityForId(type, id);
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:11,代码来源:GtfsDaoImpl.java

示例7: saveEntity

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@Override
public void saveEntity(Object entity) {
  if (packStopTimes && entity.getClass().equals(StopTime.class)) {
    stopTimes.add((StopTime) entity);
    return;
  } else if (packShapePoints && entity.getClass().equals(ShapePoint.class)) {
    shapePoints.add((ShapePoint) entity);
    return;
  }
  super.saveEntity(entity);
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:12,代码来源:GtfsDaoImpl.java

示例8: clearAllEntitiesForType

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@Override
public <T> void clearAllEntitiesForType(Class<T> type) {
  if (packStopTimes && type.equals(StopTime.class)) {
    stopTimes.clear();
    return;
  } else if (packShapePoints && type.equals(ShapePoint.class)) {
    shapePoints.clear();
    return;
  }
  super.clearAllEntitiesForType(type);
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:12,代码来源:GtfsDaoImpl.java

示例9: removeEntity

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@Override
public <K extends Serializable, T extends IdentityBean<K>> void removeEntity(
    T entity) {
  if (packStopTimes && entity.getClass().equals(StopTime.class)) {
    throw new UnsupportedOperationException();
  } else if (packShapePoints && entity.getClass().equals(ShapePoint.class)) {
    throw new UnsupportedOperationException();
  }
  super.removeEntity(entity);
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:11,代码来源:GtfsDaoImpl.java

示例10: noKeyCheck

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
/****
 * Private Methods
 ****/

private <K> void noKeyCheck(Class<K> keyType) {
  if (packStopTimes && keyType.equals(StopTime.class)) {
    throw new UnsupportedOperationException();
  }
  if (packShapePoints && keyType.equals(ShapePoint.class)) {
    throw new UnsupportedOperationException();
  }
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:13,代码来源:GtfsDaoImpl.java

示例11: ensureShapePointRelation

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
private void ensureShapePointRelation() {
  if (_shapePointsByShapeId == null) {
    _shapePointsByShapeId = mapToValueList(getAllShapePoints(), "shapeId",
        AgencyAndId.class);
    for (List<ShapePoint> shapePoints : _shapePointsByShapeId.values())
      Collections.sort(shapePoints);
  }
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:9,代码来源:GtfsRelationalDaoImpl.java

示例12: add

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
/****
 * {@link List} Interface
 ****/

@Override
public boolean add(ShapePoint shapePoint) {
  int index = size;
  size++;
  ensureCapacity(size);
  shapeIds[index] = shapePoint.getShapeId();
  sequences[index] = shapePoint.getSequence();
  lats[index] = shapePoint.getLat();
  lons[index] = shapePoint.getLon();
  distTraveled[index] = shapePoint.getDistTraveled();
  return true;
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:17,代码来源:ShapePointArray.java

示例13: get

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@Override
public ShapePoint get(int index) {
  if (index < 0 || index >= size) {
    throw new NoSuchElementException();
  }
  ShapePoint shapePoint = new ShapePoint();
  shapePoint.setProxy(new ShapePointProxyImpl(index));
  return shapePoint;
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:10,代码来源:ShapePointArray.java

示例14: next

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
@Override
public ShapePoint next() {
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  ShapePoint shapePoint = new ShapePoint();
  shapePoint.setProxy(new ShapePointProxyImpl(index));
  index++;
  return shapePoint;
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:11,代码来源:ShapePointArray.java

示例15: getShapePoint

import org.onebusaway.gtfs.model.ShapePoint; //导入依赖的package包/类
private ShapePoint getShapePoint(Iterable<ShapePoint> shapePoints,
    AgencyAndId shapeId, int sequence) {
  for (ShapePoint shapePoint : shapePoints) {
    if (shapePoint.getShapeId().equals(shapeId)
        && shapePoint.getSequence() == sequence)
      return shapePoint;
  }
  return null;
}
 
开发者ID:gov-ithub,项目名称:infotranspub-backend,代码行数:10,代码来源:GtfsReaderTest.java


注:本文中的org.onebusaway.gtfs.model.ShapePoint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。