diff options
author | Karen Butzke | 2012-09-18 19:41:34 +0000 |
---|---|---|
committer | Karen Butzke | 2012-09-18 19:41:34 +0000 |
commit | b5c90da8bd98275fa0f0625e96b61674cc95fba5 (patch) | |
tree | cf1faa7bf6f0ac5cb3883650ae1a8f89a11bbf69 | |
parent | f01bfd98943d26f4cd785cfb8a9a24337980a649 (diff) | |
download | webtools.dali-b5c90da8bd98275fa0f0625e96b61674cc95fba5.tar.gz webtools.dali-b5c90da8bd98275fa0f0625e96b61674cc95fba5.tar.xz webtools.dali-b5c90da8bd98275fa0f0625e96b61674cc95fba5.zip |
Created AbstractModifiableBooleanReference
2 files changed, 45 insertions, 18 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/AbstractBooleanReference.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/AbstractBooleanReference.java index 5e6f1b1ad6..a575827b74 100644 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/AbstractBooleanReference.java +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/AbstractBooleanReference.java @@ -9,15 +9,16 @@ ******************************************************************************/ package org.eclipse.jpt.common.utility.internal; +import org.eclipse.jpt.common.utility.BooleanReference; + /** * Convenience abstract class for boolean reference implementations. * Subclasses need only implement<ul> * <li>{@link #getValue()} - * <li>{@link #setValue(boolean)} * </ul> */ public abstract class AbstractBooleanReference - implements ModifiableBooleanReference + implements BooleanReference { protected AbstractBooleanReference() { super(); @@ -39,22 +40,6 @@ public abstract class AbstractBooleanReference return ! this.getValue(); } - public boolean flip() { - return this.setValue( ! this.getValue()); - } - - public boolean setNot(boolean value) { - return this.setValue( ! value); - } - - public boolean setTrue() { - return this.setValue(true); - } - - public boolean setFalse() { - return this.setValue(false); - } - // ********** standard methods ********** diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/AbstractModifiableBooleanReference.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/AbstractModifiableBooleanReference.java new file mode 100644 index 0000000000..6d9e1090fc --- /dev/null +++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/AbstractModifiableBooleanReference.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2012 Oracle. 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: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.common.utility.internal; + +/** + * Convenience abstract class for modifiable boolean reference implementations. + * Subclasses need only implement<ul> + * <li>{@link #getValue()} + * <li>{@link #setValue(boolean)} + * </ul> + */ +public abstract class AbstractModifiableBooleanReference + extends AbstractBooleanReference + implements ModifiableBooleanReference +{ + protected AbstractModifiableBooleanReference() { + super(); + } + + public boolean flip() { + return this.setValue( ! this.getValue()); + } + + public boolean setNot(boolean value) { + return this.setValue( ! value); + } + + public boolean setTrue() { + return this.setValue(true); + } + + public boolean setFalse() { + return this.setValue(false); + } +} |