Coverage Report - com.sun.tools.javafx.tree.JFXFunctionValue
 
Classes in this File Line Coverage Branch Coverage Complexity
JFXFunctionValue
81%
17/21
17%
1/6
0
 
 1  
 /*
 2  
  * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
 3  
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 4  
  *
 5  
  * This code is free software; you can redistribute it and/or modify it
 6  
  * under the terms of the GNU General Public License version 2 only, as
 7  
  * published by the Free Software Foundation.  Sun designates this
 8  
  * particular file as subject to the "Classpath" exception as provided
 9  
  * by Sun in the LICENSE file that accompanied this code.
 10  
  *
 11  
  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  
  * version 2 for more details (a copy is included in the LICENSE file that
 15  
  * accompanied this code).
 16  
  *
 17  
  * You should have received a copy of the GNU General Public License version
 18  
  * 2 along with this work; if not, write to the Free Software Foundation,
 19  
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  
  *
 21  
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 22  
  * CA 95054 USA or visit www.sun.com if you need additional information or
 23  
  * have any questions.
 24  
  */
 25  
 
 26  
 package com.sun.tools.javafx.tree;
 27  
 import com.sun.javafx.api.tree.JavaFXTree.JavaFXKind;
 28  
 import com.sun.javafx.api.tree.JavaFXTreeVisitor;
 29  
 import com.sun.javafx.api.tree.FunctionValueTree;
 30  
 import com.sun.source.tree.TreeVisitor;
 31  
 import com.sun.source.tree.VariableTree;
 32  
 import com.sun.tools.javac.util.List;
 33  
 import com.sun.tools.javac.tree.Pretty;
 34  
 import com.sun.tools.javac.tree.JCTree.*;
 35  
 
 36  
 /**
 37  
  *
 38  
  * @author bothner
 39  
  */
 40  16
 public class JFXFunctionValue extends JFXExpression implements FunctionValueTree {
 41  
     public JFXType rettype;
 42  
     public List<JFXVar> funParams;
 43  
     public JFXBlockExpression bodyExpression;
 44  
     public JFXFunctionDefinition definition;
 45  
 
 46  
     public JFXFunctionValue(JFXType rettype, 
 47  
             List<JFXVar> params, 
 48  1247
             JFXBlockExpression bodyExpression) {
 49  1247
         this.rettype = rettype;
 50  1247
         this.funParams = params;
 51  1247
         this.bodyExpression = bodyExpression;
 52  1247
     }
 53  
 
 54  1242
     public JFXType getJFXReturnType() { return rettype; }
 55  
     public JFXType getType() {
 56  3
         return rettype;
 57  
     }
 58  
     
 59  
     public List<JFXVar> getParams() {
 60  4570
         return funParams;
 61  
     }
 62  
     
 63  
     public java.util.List<? extends VariableTree> getParameters() {
 64  3
         return (java.util.List)funParams;
 65  
     }
 66  
 
 67  
     public JFXBlockExpression getBodyExpression() {
 68  8572
         return bodyExpression;
 69  
     }
 70  
 
 71  2107
     public void accept(JavafxVisitor v) { v.visitFunctionValue(this); }
 72  
     
 73  
     @Override
 74  
     public void accept(Visitor v) {
 75  2107
         if (v instanceof JavafxVisitor) {
 76  2107
             this.accept((JavafxVisitor)v);
 77  0
         } else if (v instanceof Pretty) {
 78  0
             JavafxPretty.visitFunctionValue((Pretty) v, this);
 79  
         } else {
 80  0
             assert false;
 81  
         }
 82  2107
     }
 83  
 
 84  
     @Override
 85  
     public int getTag() {
 86  1565
      return JavafxTag.FUNCTIONEXPRESSION;
 87  
     }
 88  
 
 89  
     public JavaFXKind getJavaFXKind() {
 90  0
         return JavaFXKind.FUNCTION_VALUE;
 91  
     }
 92  
 
 93  
     public <R, D> R accept(JavaFXTreeVisitor<R, D> visitor, D data) {
 94  3
         return visitor.visitFunctionValue(this, data);
 95  
     }
 96  
 }