@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; IdKey other = (IdKey) obj; return _id.equals(other._id); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockConfigurationReference other = (BlockConfigurationReference) obj; if (!blockId.equals(other.blockId)) return false; if (configurationIndex != other.configurationIndex) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AgencyAndIdInstance other = (AgencyAndIdInstance) obj; if (!id.equals(other.id)) return false; if (serviceDate != other.serviceDate) return false; return true; } }
/**** * {@link Object} Interface ****/ @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof StopEntryImpl)) return false; StopEntryImpl stop = (StopEntryImpl) obj; return _id.equals(stop.getId()); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockStopTimeKey other = (BlockStopTimeKey) obj; return _serviceIds.equals(other._serviceIds) && _stopId.equals(other._stopId); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockLayoverSequenceKey other = (BlockLayoverSequenceKey) obj; return _serviceIds.equals(other._serviceIds) && _firstStopId.equals(other._firstStopId); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockLayoverSequenceKey other = (BlockLayoverSequenceKey) obj; return _serviceIds.equals(other._serviceIds) && _firstStopId.equals(other._firstStopId); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockStopTimeKey other = (BlockStopTimeKey) obj; return _serviceIds.equals(other._serviceIds) && _stopId.equals(other._stopId); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockLocationRecordKey other = (BlockLocationRecordKey) obj; if (!blockInstance.equals(other.blockInstance)) return false; if (!vehicleId.equals(other.vehicleId)) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BlockLocationRecordKey other = (BlockLocationRecordKey) obj; if (!blockInstance.equals(other.blockInstance)) return false; if (!vehicleId.equals(other.vehicleId)) return false; return true; }
private boolean isMatch(List<StopTimeEntry> stopTimes, AgencyAndId stopId, int index) { if (index < 0 || index >= stopTimes.size()) return false; StopTimeEntry stopTime = stopTimes.get(index); StopEntry stop = stopTime.getStop(); return stop.getId().equals(stopId); }
private boolean isMatch(List<StopTimeEntry> stopTimes, AgencyAndId stopId, int index) { if (index < 0 || index >= stopTimes.size()) return false; StopTimeEntry stopTime = stopTimes.get(index); StopEntry stop = stopTime.getStop(); return stop.getId().equals(stopId); }
private AgencyAndId computeUpdatedTripIdForMergedTripsIfApplicable( Map<AgencyAndId, List<AgencyAndId>> mergeToolIdMapping, List<Trip> trips) { AgencyAndId unmergedTripId = null; for (Trip trip : trips) { AgencyAndId id = computeUnmergedTripId(trip.getId()); if (unmergedTripId == null) { unmergedTripId = id; } else if (!unmergedTripId.equals(id)) { return null; } } List<AgencyAndId> originalIds = mergeToolIdMapping.get(unmergedTripId); if (originalIds == null || originalIds.size() != trips.size()) return null; return unmergedTripId; }
private static AgencyAndId checkVehicleId(AgencyAndId existing, BlockLocationRecord record) { if (existing == null) return record.getVehicleId(); else if (!existing.equals(record.getVehicleId())) throw new IllegalArgumentException("vehicleId mismatch: expected=" + existing + " actual=" + record.getVehicleId()); return existing; }
private static AgencyAndId checkVehicleId(AgencyAndId existing, BlockLocationRecord record) { if (existing == null) return record.getVehicleId(); else if (!existing.equals(record.getVehicleId())) throw new IllegalArgumentException("vehicleId mismatch: expected=" + existing + " actual=" + record.getVehicleId()); return existing; }
/** * @param stopTime * @return true if the given stop is the first or the last stop in given trip */ private boolean isFirstOrLastStopInTrip(StopTimeEntry stopTime) { List<StopTimeEntry> stopTimes = stopTime.getTrip().getStopTimes(); AgencyAndId firstStopId = stopTimes.get(0).getStop().getId(); AgencyAndId lastStopId = stopTimes.get(stopTimes.size() -1).getStop().getId(); AgencyAndId currentStopId = stopTime.getStop().getId(); return firstStopId.equals(currentStopId) || lastStopId.equals(currentStopId); }
public boolean equals(Object other) { if (other instanceof StopPattern) { StopPattern pattern = (StopPattern) other; return pattern.stops.equals(stops) && pattern.calendarId.equals(calendarId) && pattern.pickups.equals(pickups) && pattern.dropoffs.equals(dropoffs); } else { return false; } }
private BlockTripEntry getBlockTripEntry(BlockConfigurationEntry blockConfig, AgencyAndId tripId) { for (BlockTripEntry blockTrip : blockConfig.getTrips()) { if (blockTrip.getTrip().getId().equals(tripId)) return blockTrip; } return null; }
/** * Checks if the first and the last stop of the trip are the same * @param stopTime * @return true if its loop route */ private boolean isLoopRoute(StopTimeEntry stopTime) { List<StopTimeEntry> stopTimes = stopTime.getTrip().getStopTimes(); AgencyAndId firstStopId = stopTimes.get(0).getStop().getId(); AgencyAndId lastStopId = stopTimes.get(stopTimes.size() -1).getStop().getId(); return firstStopId.equals(lastStopId); }
@Override public void handleEntity(Object bean) { BlockLocationArchiveRecord record = (BlockLocationArchiveRecord) bean; if (!_tripId.equals(record.getTripId())) return; AgencyAndIdInstance instance = new AgencyAndIdInstance( record.getTripId(), record.getServiceDate()); _recordsByInstance.get(instance).add(record); _distanceAlongBlockRange.addValue(record.getDistanceAlongBlock()); _scheduleDeviationRange.addValue(record.getScheduleDeviation()); } }