Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [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 | package org.onosproject.net; |
| 17 | |
| 18 | import org.onlab.util.Frequency; |
| 19 | |
| 20 | /** |
| 21 | * Represents interval frequency between two neighboring wavelengths. |
| 22 | */ |
| 23 | public enum ChannelSpacing { |
Sho SHIMIZU | 00762ee | 2016-01-05 16:32:24 -0800 | [diff] [blame] | 24 | CHL_100GHZ(100_000), // 100 GHz |
| 25 | CHL_50GHZ(50_000), // 50 GHz |
| 26 | CHL_25GHZ(25_000), // 25 GHz |
| 27 | CHL_12P5GHZ(12_500), // 12.5 GHz |
Diego Garcia | 09ab5e2 | 2018-12-18 11:47:01 +0100 | [diff] [blame] | 28 | CHL_6P25GHZ(6_250), // 6.25 GHz |
| 29 | CHL_0GHZ(0); // 0 GHz (Unknown) |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 30 | |
| 31 | private final Frequency frequency; |
| 32 | |
| 33 | /** |
Jimmy Yan | da878fc | 2016-09-02 16:32:01 -0700 | [diff] [blame] | 34 | * Creates an instance with the specified interval in MHz. |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 35 | * |
Jimmy Yan | da878fc | 2016-09-02 16:32:01 -0700 | [diff] [blame] | 36 | * @param value interval of neighboring wavelengths in MHz. |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 37 | */ |
Sho SHIMIZU | 00762ee | 2016-01-05 16:32:24 -0800 | [diff] [blame] | 38 | ChannelSpacing(long value) { |
| 39 | this.frequency = Frequency.ofMHz(value); |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | public Frequency frequency() { |
| 43 | return frequency; |
| 44 | } |
| 45 | } |