|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.javacore.jmiimpl.javamodel; import java.util.List; import org.netbeans.jmi.javamodel.FloatLiteral; import org.netbeans.jmi.javamodel.JavaModelPackage; import org.netbeans.jmi.javamodel.PrimitiveTypeKindEnum; import org.netbeans.lib.java.parser.Token; import org.netbeans.mdr.storagemodel.StorableObject; /** * * @author mm109185 */ public abstract class FloatLiteralImpl extends LiteralImpl implements FloatLiteral { private float value; /** Creates a new instance of FloatLiteralImpl */ public FloatLiteralImpl(StorableObject o) { super(o); type = ((JavaModelPackage) refImmediatePackage()).getType().resolve(PrimitiveTypeKindEnum.FLOAT.toString()); } public void setValue(float value) { objectChanged(CHANGED_VALUE); this.value = value; } public float getValue() { if (isChanged(CHANGED_VALUE)) { return value; } else { return ((Float) ((Token) getASTree()).getValue()).floatValue(); } } public String getSourceText() { String origElem; if ((origElem = checkChange()) != null) return origElem; return String.valueOf((float) getValue()); } public void getDiff(List diff) { if (isChanged(CHANGED_VALUE)) { replaceNode(diff, getParser(), getASTree(), String.valueOf((float) getValue()), 0, null); } } void setData(float value) { this.value = value; } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.