
util.parallel.ParallelFuture Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xfvrp Show documentation
Show all versions of xfvrp Show documentation
Solver for realistic vehicle routing problems
package util.parallel;
import java.util.List;
/**
* Copyright (c) 2012-present Holger Schneider
* All rights reserved.
*
* This source code is licensed under the MIT License (MIT) found in the
* LICENSE file in the root directory of this source tree.
*
*
* @author hschneid
*
* @param
*/
public abstract class ParallelFuture implements Runnable, Cloneable {
private E o;
private List list;
public ParallelFuture() {}
/**
*
* @param o
* @return
*/
public abstract A run(E o);
/*
* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
@Override
public void run() {
try {
if(o != null)
list.add(run(o));
} catch (Exception e) {
e.printStackTrace();
}
}
/**
*
* @param o
* @param list
*/
void set(E o, List list) {
this.o = o;
this.list = list;
}
/**
*
* @return
* @throws CloneNotSupportedException
*/
@SuppressWarnings("unchecked")
public ParallelFuture copy() throws CloneNotSupportedException {
return (ParallelFuture) super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy