public StopTime getStopTimeForId(int id) { if (packStopTimes) { return stopTimes.get(id); } return getEntityForId(StopTime.class, id); }
@Override public void clear() { size = 0; setLength(0); }
@Override public void close() { if (packStopTimes) { stopTimes.trimToSize(); } if (packShapePoints) { shapePoints.trimToSize(); } super.close(); }
@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); }
@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); }
/**** * {@link Collection} Interface ****/ @Override public boolean add(StopTime stopTime) { int index = size; size++; ensureCapacity(size); trips[index] = stopTime.getTrip(); stops[index] = stopTime.getStop(); arrivalTimes[index] = stopTime.getArrivalTime(); departureTimes[index] = stopTime.getDepartureTime(); timepoints[index] = stopTime.getTimepoint(); stopSequences[index] = stopTime.getStopSequence(); stopHeadsigns[index] = stopTime.getStopHeadsign(); routeShortNames[index] = stopTime.getRouteShortName(); pickupTypes[index] = stopTime.getPickupType(); dropOffTypes[index] = stopTime.getDropOffType(); shapeDistTraveled[index] = stopTime.getShapeDistTraveled(); return true; }
@Override public void close() { if (packStopTimes) { stopTimes.trimToSize(); } if (packShapePoints) { shapePoints.trimToSize(); } super.close(); }
@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); }
@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); }
/**** * {@link Collection} Interface ****/ @Override public boolean add(StopTime stopTime) { int index = size; size++; ensureCapacity(size); trips[index] = stopTime.getTrip(); stops[index] = stopTime.getStop(); arrivalTimes[index] = stopTime.getArrivalTime(); departureTimes[index] = stopTime.getDepartureTime(); timepoints[index] = stopTime.getTimepoint(); stopSequences[index] = stopTime.getStopSequence(); stopHeadsigns[index] = stopTime.getStopHeadsign(); routeShortNames[index] = stopTime.getRouteShortName(); pickupTypes[index] = stopTime.getPickupType(); dropOffTypes[index] = stopTime.getDropOffType(); shapeDistTraveled[index] = stopTime.getShapeDistTraveled(); return true; }
@Override public void clear() { size = 0; setLength(0); }
public StopTime getStopTimeForId(int id) { if (packStopTimes) { return stopTimes.get(id); } return getEntityForId(StopTime.class, id); }
public void trimToSize() { setLength(size); }
@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); }
public void trimToSize() { setLength(size); }
@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); }
/**** * Private Methods ****/ private void ensureCapacity(int capacity) { if (trips.length < capacity) { int newLength = Math.max(8, trips.length << 2); setLength(newLength); } }
/**** * Private Methods ****/ private void ensureCapacity(int capacity) { if (trips.length < capacity) { int newLength = Math.max(8, trips.length << 2); setLength(newLength); } }