package de.uka.ipd.sdq.beagle.core;

import de.uka.ipd.sdq.beagle.core.facade.BeagleConfiguration;
import de.uka.ipd.sdq.beagle.core.facade.SourceCodeFileProvider;

import java.io.Serializable;

/**
 * Hold information about the project under analysis. Objects of this class are immutable.
 *
 * @author Roman Langrehr
 */
public class ProjectInformation implements Serializable {

	/**
	 * See {@link Serializable}.
	 */
	private static final long serialVersionUID = 2451089669559562551L;

	/**
	 * The timeout to be used. [-2 → adaptive timeout] [-1 → no timeout] [≥ 0 → timeout in
	 * seconds]
	 */
	private int timeout;

	/**
	 * The provider of the source files to be analysed.
	 */
	private SourceCodeFileProvider fileProvider;

	/**
	 * Creates a new Project Information.
	 *
	 * @param timeout The timeout to be used
	 *
	 *            <table> <caption>timeout value description</caption>
	 *
	 *            <tr><td>{@link BeagleConfiguration#ADAPTIVE_TIMEOUT}</td><td>Beagle will
	 *            use a timeout that adapts to the quality of the analysis’ findings in
	 *            the past.</td>
	 *
	 *            <tr><td>{@link BeagleConfiguration#NO_TIMEOUT}</td><td>no timeout will
	 *            be used</td>
	 *
	 *            <tr><td>{@code ≥ 0}</td><td>the given value will be used as a fixed
	 *            timeout in seconds</td>
	 *
	 *            </table>
	 * @param fileProvider The provider of the source files to be analysed
	 */
	public ProjectInformation(final int timeout, final SourceCodeFileProvider fileProvider) {
		super();
		this.timeout = timeout;
		this.fileProvider = fileProvider;
	}

	/**
	 * Returns the timeout to be used. The timeout describes the minimum time Beagle shall
	 * keep trying to find results while no perfect results were found.
	 *
	 * <table> <caption>timeout value description</caption>
	 *
	 * <tr><td>{@link BeagleConfiguration#ADAPTIVE_TIMEOUT}</td><td>Beagle will use a
	 * timeout that adapts to the quality of the analysis’ findings in the past.</td>
	 *
	 * <tr><td>{@link BeagleConfiguration#NO_TIMEOUT}</td><td>no timeout will be used</td>
	 *
	 * <tr><td>{@code ≥ 0}</td><td>the given value will be used as a fixed timeout in
	 * seconds</td>
	 *
	 * </table>
	 *
	 * @return The timeout that will be used by Beagle.
	 */
	public int getTimeout() {
		return this.timeout;
	}

	/**
	 * Queries the provider responsible to get the source files Beagle shall analyse.
	 *
	 *
	 * @return The provider of source files.
	 */
	public SourceCodeFileProvider getFileProvider() {
		return this.fileProvider;
	}
}

@@ -169,28 +169,104 @@
 ort 
-java.io.Serializable
+org.apache.commons.lang3.Validate;%0A%0Aimport java.io.Serializable;%0Aimport java.nio.charset.Charset
 ;%0A%0A/
@@ -275,16 +275,17 @@
 %0A * Hold
+s
  informa
@@ -348,16 +348,19 @@
 lass are
+%0A *
  immutab
@@ -684,16 +684,22 @@
 private 
+final 
 int time
@@ -776,16 +776,22 @@
 private 
+final 
 SourceCo
@@ -820,16 +820,226 @@
 vider;%0A%0A
+%09/**%0A%09 * The class path containing everything needed to compile the project.%0A%09 */%0A%09private final String buildPath;%0A%0A%09/**%0A%09 * The charset used for all files in the project.%0A%09 */%0A%09private final Charset charset;%0A%0A
 %09/**%0A%09 *
@@ -1119,16 +1119,17 @@
  be used
+.
 %0A%09 *%0A%09 *
@@ -1747,116 +1747,488 @@
 ysed
-%0A%09 */%0A%09public ProjectInformation(final int timeout, final SourceCodeFileProvider fileProvider) %7B%0A%09%09super(
+.%0A%09 * @param buildPath The class path containing everything needed to compile the%0A%09 *            project.%0A%09 * @param charset The charset used for all files in the project. May be %7B@code null%7D,%0A%09 *            in which case %7B@link Charset#defaultCharset()%7D will be used.%0A%09 */%0A%09public ProjectInformation(final int timeout, final SourceCodeFileProvider fileProvider, final String buildPath,%0A%09%09final Charset charset) %7B%0A%09%09Validate.notNull(fileProvider);%0A%09%09Validate.notNull(buildPath
 );%0A
+%0A
 %09%09th
@@ -2285,16 +2285,544 @@
 ovider;%0A
+%09%09this.charset = charset == null ? Charset.defaultCharset() : charset;%0A%09%09this.buildPath = buildPath;%0A%09%7D%0A%0A%09/**%0A%09 * Queries the project%E2%80%99s build path.%0A%09 *%0A%09 * @return The class path containing everything needed to compile the project. Will%0A%09 *         never be %7B@code null%7D.%0A%09 */%0A%09public String getBuildPath() %7B%0A%09%09return this.buildPath;%0A%09%7D%0A%0A%09/**%0A%09 * Queries the project%E2%80%99s charset.%0A%09 *%0A%09 * @return The charset used for all files in the project. Will never be %7B@code null%7D.%0A%09 */%0A%09public Charset getCharset() %7B%0A%09%09return this.charset;%0A
 %09%7D%0A%0A%09/**

Add project build path and charset