本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}