MatrixResult.java

  1. /*  This file is part of Openrouteservice.
  2.  *
  3.  *  Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the
  4.  *  GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1
  5.  *  of the License, or (at your option) any later version.

  6.  *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  7.  *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8.  *  See the GNU Lesser General Public License for more details.

  9.  *  You should have received a copy of the GNU Lesser General Public License along with this library;
  10.  *  if not, see <https://www.gnu.org/licenses/>.
  11.  */
  12. package org.heigit.ors.matrix;

  13. public class MatrixResult {
  14.     private final float[][] tables;
  15.     private ResolvedLocation[] destinations;
  16.     private ResolvedLocation[] sources;
  17.     private String graphDate;

  18.     public MatrixResult(ResolvedLocation[] sources, ResolvedLocation[] destinations) {
  19.         tables = new float[6][];
  20.         this.sources = sources;
  21.         this.destinations = destinations;
  22.     }

  23.     public void setTable(int metric, float[] values) {
  24.         tables[metric] = values;
  25.     }

  26.     public float[] getTable(int metric) {
  27.         return tables[metric];
  28.     }

  29.     public float[][] getTables() {
  30.         return tables;
  31.     }

  32.     public ResolvedLocation[] getDestinations() {
  33.         return destinations;
  34.     }

  35.     public void setDestinations(ResolvedLocation[] locations) {
  36.         destinations = locations;
  37.     }

  38.     public ResolvedLocation[] getSources() {
  39.         return sources;
  40.     }

  41.     public void setSources(ResolvedLocation[] locations) {
  42.         sources = locations;
  43.     }

  44.     public void setGraphDate(String graphDate) {
  45.         this.graphDate = graphDate;
  46.     }

  47.     public String getGraphDate() {
  48.         return graphDate;
  49.     }
  50. }