com.greenpineyu.fel.function.operator
类 CollectionGet

java.lang.Object
  继承者 com.greenpineyu.fel.function.StableFunction
      继承者 com.greenpineyu.fel.function.operator.CollectionGet
所有已实现的接口:
Function, Stable

public class CollectionGet
extends StableFunction

根据索引获取某个集合的值,相当于List.get(i)方法和array[i]方法。 用于处理array[i],list[i]等表达式, 同时也可以处理支持实现了iterator的类,如Set。

作者:
yuqingsong

构造方法摘要
CollectionGet()
           
 
方法摘要
static void assertCompile(String exp, FelEngine engine, Object expected)
           
static void assertEval(String exp, FelEngine engine, Object expected)
           
 Object call(FelNode node, FelContext context)
          调用函数
static Object get(Object object, int index)
           
 String[][] getA()
           
 String getName()
          获取函数的名称
 int[][] getNum()
           
static void main(String[] args)
           
 void setA(String[][] a)
           
 void setNum(int[][] num)
           
static void test()
           
 SourceBuilder toMethod(FelNode node, FelContext ctx)
           
 
从类 com.greenpineyu.fel.function.StableFunction 继承的方法
stable
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

CollectionGet

public CollectionGet()
方法详细信息

call

public Object call(FelNode node,
                   FelContext context)
从接口 Function 复制的描述
调用函数

返回:

getName

public String getName()
从接口 Function 复制的描述
获取函数的名称

返回:

toMethod

public SourceBuilder toMethod(FelNode node,
                              FelContext ctx)

get

public static Object get(Object object,
                         int index)

getNum

public int[][] getNum()

setNum

public void setNum(int[][] num)

getA

public String[][] getA()

setA

public void setA(String[][] a)

main

public static void main(String[] args)
                 throws SecurityException,
                        NoSuchMethodException
抛出:
SecurityException
NoSuchMethodException

test

public static void test()

assertEval

public static void assertEval(String exp,
                              FelEngine engine,
                              Object expected)

assertCompile

public static void assertCompile(String exp,
                                 FelEngine engine,
                                 Object expected)


Copyright © 2013. All Rights Reserved.