Skip to content

Commit

Permalink
Use HierarchicalMapById
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Jul 8, 2024
1 parent 0ca9720 commit eabbf6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package org.opentripplanner.netex.index;

import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.opentripplanner.netex.index.api.NetexEntityIndexReadOnlyView;
import org.opentripplanner.netex.index.api.ReadOnlyHierarchicalMap;
import org.opentripplanner.netex.index.api.ReadOnlyHierarchicalMapById;
Expand Down Expand Up @@ -101,7 +98,7 @@ public class NetexEntityIndex {
public final HierarchicalVersionMapById<StopPlace> stopPlaceById;
public final HierarchicalVersionMapById<TariffZone_VersionStructure> tariffZonesById;
public final HierarchicalMapById<Branding> brandingById;
public final Set<Parking> parkings;
public final HierarchicalMapById<Parking> parkings;

// Relations between entities - The Netex XML sometimes relies on the
// nested structure of the XML document, rater than explicit references.
Expand Down Expand Up @@ -147,7 +144,7 @@ public NetexEntityIndex() {
this.tariffZonesById = new HierarchicalVersionMapById<>();
this.brandingById = new HierarchicalMapById<>();
this.timeZone = new HierarchicalElement<>();
this.parkings = new HashSet<>(0);
this.parkings = new HierarchicalMapById<>();
}

/**
Expand Down Expand Up @@ -190,7 +187,7 @@ public NetexEntityIndex(NetexEntityIndex parent) {
this.tariffZonesById = new HierarchicalVersionMapById<>(parent.tariffZonesById);
this.brandingById = new HierarchicalMapById<>(parent.brandingById);
this.timeZone = new HierarchicalElement<>(parent.timeZone);
this.parkings = new HashSet<>(parent.parkings);
this.parkings = new HierarchicalMapById<>(parent.parkings);
}

/**
Expand Down Expand Up @@ -361,8 +358,8 @@ public ReadOnlyHierarchicalVersionMapById<StopPlace> getStopPlaceById() {
}

@Override
public ImmutableSet<Parking> getParkings() {
return ImmutableSet.copyOf(parkings);
public ReadOnlyHierarchicalMapById<Parking> getParkings() {
return parkings;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.opentripplanner.netex.index.api;

import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import org.rutebanken.netex.model.Authority;
import org.rutebanken.netex.model.Branding;
Expand Down Expand Up @@ -82,7 +81,7 @@ public interface NetexEntityIndexReadOnlyView {

ReadOnlyHierarchicalVersionMapById<StopPlace> getStopPlaceById();

ImmutableSet<Parking> getParkings();
ReadOnlyHierarchicalMapById<Parking> getParkings();

ReadOnlyHierarchicalVersionMapById<TariffZone_VersionStructure> getTariffZonesById();

Expand Down

0 comments on commit eabbf6c

Please sign in to comment.