Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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 |
| 28 | CHL_6P25GHZ(6_250); // 6.25 GHz |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 29 | |
| 30 | private final Frequency frequency; |
| 31 | |
| 32 | /** |
| 33 | * Creates an instance with the specified interval in GHz. |
| 34 | * |
| 35 | * @param value interval of neighboring wavelengths in GHz. |
| 36 | */ |
Sho SHIMIZU | 00762ee | 2016-01-05 16:32:24 -0800 | [diff] [blame] | 37 | ChannelSpacing(long value) { |
| 38 | this.frequency = Frequency.ofMHz(value); |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | public Frequency frequency() { |
| 42 | return frequency; |
| 43 | } |
| 44 | } |