01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.launching.environments;
11:
12: /**
13: * The result of analyzing a vm install for compatibility with an execution
14: * environment.
15: * <p>
16: * An environment analyzer delegate creates instances of this class to describe
17: * the environments a vm install is compatible with. A result describes
18: * a compatible environment for a vm install and whether the vm install is strictly
19: * compatible with the environment or whether the vm install represents
20: * a superset of the environment (that is, represents more than is minimally required
21: * to be compatible with an environment).
22: * </p>
23: * <p>
24: * Clients may instantiate this class; not intended to be subclassed.
25: * </p>
26: * @since 3.2
27: */
28: public class CompatibleEnvironment {
29:
30: private IExecutionEnvironment fEnvironment;
31: private boolean fIsStrictlyCompatible;
32:
33: /**
34: * Constructs a new compatible environment result from an execution environment
35: * analysis.
36: *
37: * @param environment the environment a vm install is compatible with
38: * @param strict whether the vm install is strictly compatible with the
39: * environment or represents a superset of the environment
40: */
41: public CompatibleEnvironment(IExecutionEnvironment environment,
42: boolean strict) {
43: fEnvironment = environment;
44: fIsStrictlyCompatible = strict;
45: }
46:
47: /**
48: * Returns an environment compatible with the vm being analyzed.
49: *
50: * @return compatible execution environment
51: */
52: public IExecutionEnvironment getCompatibleEnvironment() {
53: return fEnvironment;
54: }
55:
56: /**
57: * Returns whether the analyzed vm install is strictly compatible with the compatible
58: * environment or represents a superset of the environment. Returning <code>true</code>
59: * indicates the analyzed vm install is strictly contained within the environment. Returning
60: * <code>false</code> indicates that the analyzed vm install represents more a superset of
61: * the environment.
62: *
63: * @return whether the analyzed vm install is strictly contained within the environment
64: */
65: public boolean isStrictlyCompatbile() {
66: return fIsStrictlyCompatible;
67: }
68: }
|