Skip to main content
summaryrefslogtreecommitdiffstats
blob: 77ec3c4dc0138c31433bb9f9cef7ee1a14c5dba3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*******************************************************************************
 * Copyright (c) 2001, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jem.internal.proxy.remote;
/*


 */


import org.eclipse.jem.internal.proxy.core.*;
import org.eclipse.jem.internal.proxy.common.remote.Commands;
/**
 * Remote Implementation of IBooleanBeanProxy for Boolean.class.
 * Creation date: (2/6/00 9:02:54 AM)
 * @author: Joe Winchester
 */
final class REMBooleanClassBeanProxy extends REMConstantBeanProxy implements IBooleanBeanProxy {
	private final Boolean fBooleanValue;

/**
 * Store the boolean value so that we can return the booleanValue faster
 * without the need for going across the line. It is package protected because it is created in
 * special way, so no one else should create these.
 * @param aBean java.lang.Object
 */
REMBooleanClassBeanProxy(REMProxyFactoryRegistry aRegistry, Boolean value) {
	super(aRegistry);
	fBooleanValue = value;
}

/**
 * equals: Equal if:
 *         1) This proxy == (identity) to the other object
 *         2) Else if other is an IBeanProxy and not a constant one, then if
 *            equals on the server.
 *         3) If this is a constant proxy and the other is too or is a constant
 *            value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
 */
public boolean equals(Object anObject) {
	if (this == anObject)
		return true;	// Identity
	if (anObject instanceof REMBooleanClassBeanProxy)
		return fBooleanValue.booleanValue() == ((REMBooleanClassBeanProxy) anObject).booleanValue();
	if (anObject instanceof Boolean)
		return fBooleanValue.booleanValue() == ((Boolean) anObject).booleanValue();
	return false;
}

/**
 * Return the boolean value
 */
public boolean booleanValue() {
	return fBooleanValue.booleanValue();
}
/**
 * Return the java.lang.Boolean value
 */
public Boolean getBooleanValue() {
	return fBooleanValue;
}

/**
 * Return the toString of the bean itself.
 */
public String toBeanString() {
	return fBooleanValue.toString();
}

/**
 * Get the beantype
 */
public IBeanTypeProxy getTypeProxy() {
	return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).booleanClass;
}

/**
 * Render the bean into value object.
 */
public void renderBean(Commands.ValueObject value) {
	value.set(fBooleanValue);
}
}






Back to the top