Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0a4e674 | 2016-09-15 23:03:10 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.ui; |
| 18 | |
| 19 | /** |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 20 | * Represents a geographically-based map to be used in the user interface |
| 21 | * topology view. Instances of this class are immutable. |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 22 | */ |
| 23 | public class UiTopoMap { |
| 24 | |
| 25 | private final String id; |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 26 | private final String desc; |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 27 | private final String filePath; |
| 28 | private final double scale; |
| 29 | |
| 30 | |
| 31 | /** |
| 32 | * Creates a new topology map. |
| 33 | * |
| 34 | * @param id map identifier |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 35 | * @param desc map description |
| 36 | * @param filePath map filePath |
| 37 | * @param scale map scale |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 38 | */ |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 39 | public UiTopoMap(String id, String desc, String filePath, double scale) { |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 40 | this.id = id; |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 41 | this.desc = desc; |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 42 | this.filePath = filePath; |
| 43 | this.scale = scale; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Returns the identifier for this map. |
| 48 | * |
| 49 | * @return the identifier |
| 50 | */ |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 51 | public String id() { |
| 52 | return id; |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Returns the description for this map. |
| 57 | * |
| 58 | * @return the description |
| 59 | */ |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 60 | public String description() { |
| 61 | return desc; |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Returns the filePath for this map. |
| 66 | * |
| 67 | * @return the filePath |
| 68 | */ |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 69 | public String filePath() { |
| 70 | return filePath; |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Returns the scale for this map. |
| 75 | * |
| 76 | * @return the scale |
| 77 | */ |
Simon Hunt | 8add9ee | 2016-09-20 17:05:07 -0700 | [diff] [blame] | 78 | public double scale() { |
| 79 | return scale; |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 80 | } |
Steven Burrows | 3a9a644 | 2016-05-05 15:31:16 +0100 | [diff] [blame] | 81 | } |