2 * Copyright © 2017 Orange, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.common.fixedflex;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
14 public final class FixedFlexImpl implements FixedFlexInterface {
15 private static final Logger LOG = LoggerFactory.getLogger(FixedFlexImpl.class);
17 private double centerFrequency;
20 private double wavelength;
22 public FixedFlexImpl(Long index, double centreFrequency, double start, double stop, double wavelength) {
24 this.centerFrequency = centreFrequency;
27 this.wavelength = wavelength;
30 public FixedFlexImpl() {
32 this.centerFrequency = 0;
38 public FixedFlexImpl(long wlIndex) {
40 this.centerFrequency = 196.1 - (wlIndex - 1) * 0.05;
41 this.start = this.centerFrequency - 0.025;
42 this.stop = this.centerFrequency + 0.025;
43 this.wavelength = 1528.77 + ((wlIndex - 1) * 0.39);
48 * @param index Wavelength number
49 * @return Returns FixedFlexImp object with the calculated result.
51 public FixedFlexImpl getFixedFlexWaveMapping(long wlIndex) {
52 FixedFlexImpl fixedFlex = new FixedFlexImpl();
53 fixedFlex.centerFrequency = 196.1 - (wlIndex - 1) * 0.05;
54 fixedFlex.wavelength = 1528.77 + ((wlIndex - 1) * 0.39);
55 fixedFlex.start = fixedFlex.centerFrequency - 0.025;
56 fixedFlex.stop = fixedFlex.centerFrequency + 0.025;
60 public double getCenterFrequency() {
61 return centerFrequency;
64 public double getStart() {
68 public long getIndex() {
72 public double getStop() {
76 public double getWavelength() {