KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > launching > environments > CompatibleEnvironment


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.launching.environments;
12
13
14 /**
15  * The result of analyzing a vm install for compatibility with an execution
16  * environment.
17  * <p>
18  * An environment analyzer delegate creates instances of this class to describe
19  * the environments a vm install is compatible with. A result describes
20  * a compatible environment for a vm install and whether the vm install is strictly
21  * compatible with the environment or whether the vm install represents
22  * a superset of the environment (that is, represents more than is minimally required
23  * to be compatible with an environment).
24  * </p>
25  * <p>
26  * Clients may instantiate this class; not intended to be subclassed.
27  * </p>
28  * @since 3.2
29  */

30 public class CompatibleEnvironment {
31
32     private IExecutionEnvironment fEnvironment;
33     private boolean fIsStrictlyCompatible;
34     
35     /**
36      * Constructs a new compatible environment result from an execution environment
37      * analysis.
38      *
39      * @param environment the environment a vm install is compatible with
40      * @param strict whether the vm install is strictly compatible with the
41      * environment or represents a superset of the environment
42      */

43     public CompatibleEnvironment(IExecutionEnvironment environment, boolean strict) {
44         fEnvironment = environment;
45         fIsStrictlyCompatible = strict;
46     }
47     
48     /**
49      * Returns an environment compatible with the vm being analyzed.
50      *
51      * @return compatible execution environment
52      */

53     public IExecutionEnvironment getCompatibleEnvironment() {
54         return fEnvironment;
55     }
56     
57     /**
58      * Returns whether the analyzed vm install is strictly compatible with the compatible
59      * environment or represents a superset of the environment. Returning <code>true</code>
60      * indicates the analyzed vm install is strictly contained within the environment. Returning
61      * <code>false</code> indicates that the analyzed vm install represents more a superset of
62      * the environment.
63      *
64      * @return whether the analyzed vm install is strictly contained within the environment
65      */

66     public boolean isStrictlyCompatbile() {
67         return fIsStrictlyCompatible;
68     }
69 }
70
Popular Tags