📄 tostringcompoundinfo.java
字号:
package com.sri.oaa2.icl;
import java.util.HashMap;
final class ToStringCompoundInfo
{
int numChildrenToDo = -1;
int originalNumChildren = -1;
String postPend = null;
boolean needsCommas = true;
HashMap preChild = new HashMap();
HashMap postChild = new HashMap();
String preAllButFirst = null;
String postAllButLast = null;
public IclTerm origTerm;
public boolean finished()
{
return (numChildrenToDo == 0);
}
public int getCurrentChildNum()
{
return originalNumChildren - numChildrenToDo;
}
public void setPostPend(String s)
{
postPend = s;
}
public String getPostPend()
{
return postPend;
}
public void setPreAllButFirst(String s)
{
preAllButFirst = s;
}
public void setPostAllButLast(String s)
{
postAllButLast = s;
}
public void setPreChild(int i, String s)
{
if(s == null) {
preChild.remove(new Integer(i));
}
else {
preChild.put(new Integer(i), s);
}
}
public void setPreAll(String s)
{
for(int i = 0; i < this.originalNumChildren; ++i) {
this.setPreChild(i, s);
}
}
public String getPreChild(int i)
{
Integer io = new Integer(i);
if(preChild.containsKey(io)) {
return (String)preChild.get(new Integer(i));
}
if(preAllButFirst != null) {
if(i != 0) {
return preAllButFirst;
}
else {
return null;
}
}
else {
return null;
}
}
public void setPostChild(int i, String s)
{
if(s == null) {
postChild.remove(new Integer(i));
}
else {
postChild.put(new Integer(i), s);
}
}
public String getPostChild(int i)
{
Integer io = new Integer(i);
if(postChild.containsKey(io)) {
return (String)postChild.get(new Integer(i));
}
if(postAllButLast != null) {
if(i != originalNumChildren - 1) {
return postAllButLast;
}
else {
return null;
}
}
else {
return null;
}
}
public void setNumChildren(int n)
{
numChildrenToDo = n;
originalNumChildren = n;
}
public int getNumChildren()
{
return numChildrenToDo;
}
public void childFinished()
{
--numChildrenToDo;
}
public boolean getNeedsCommas()
{
return this.needsCommas;
}
public void setNeedsCommas(boolean n)
{
this.needsCommas = n;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -