Package ch.rakudave.jnetmap.model.factories

Source Code of ch.rakudave.jnetmap.model.factories.ConnectionFactory

package ch.rakudave.jnetmap.model.factories;

import org.apache.commons.collections15.Factory;

import ch.rakudave.jnetmap.model.Connection;
import ch.rakudave.jnetmap.model.Connection.Type;

public class ConnectionFactory implements Factory<Connection> {
  private static Type type = Type.Ethernet;
  private static double speed = 100;

  @Override
  public Connection create() {
    return new Connection(type, speed);
  }

  public static void setType(Type t) {
    if (t != null) type = t;
  }
 
  public static void setSpeed(double s) {
    speed = s;
  }
}
TOP

Related Classes of ch.rakudave.jnetmap.model.factories.ConnectionFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.