public class StatList extends Stat
Modifier and Type | Field and Description |
---|---|
static Stat |
NULL_STAT |
static Stat[] |
NULL_STAT_ARRAY |
Modifier and Type | Method and Description |
---|---|
void |
exec(Env env,
Scope scope,
Writer writer) |
Stat |
getActualStat()
持有 StatList 的指令可以通过此方法提升 AST 执行性能
1:当 statArray.length > 1 时返回 StatList 自身
2:当 statArray.length == 1 时返回 statArray[0]
3:其它情况返回 NullStat
意义在于,当满足前面两个条件时,避免掉了 StatList.exec(...) 方法中的判断与循环
|
Stat |
getStat(int index) |
int |
length() |
getLocation, hasEnd, setExprList, setLocation, setStat, write
public static final Stat NULL_STAT
public static final Stat[] NULL_STAT_ARRAY
public Stat getActualStat()
public int length()
public Stat getStat(int index)
Copyright © 2018. All rights reserved.