/** {@inheritDoc} */ @Override public IASTMutable copy() { return new AST0(arg0); }
private Object writeReplace() throws ObjectStreamException { return optional(F.GLOBAL_IDS_MAP.get(this)); }
objectOutput.writeShort(fEvalFlags); int size = size(); byte attributeFlags = (byte) 0; ExprID temp = F.GLOBAL_IDS_MAP.get(head()); if (temp != null) { short exprID = temp.getExprID(); exprIDArray[0] = exprID; for (int i = 1; i < size; i++) { temp = F.GLOBAL_IDS_MAP.get(get(i)); if (temp == null) { break; objectOutput.writeObject(get(i)); objectOutput.writeInt(size); for (int i = 0; i < size; i++) { objectOutput.writeObject(get(i));
@Override public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { this.fEvalFlags = objectInput.readShort(); int size; byte attributeFlags = objectInput.readByte(); if (attributeFlags != 0) { size = attributeFlags; int exprIDSize = objectInput.readByte(); for (int i = 0; i < exprIDSize; i++) { set(i, F.GLOBAL_IDS[objectInput.readShort()]); } for (int i = exprIDSize; i < size; i++) { set(i, (IExpr) objectInput.readObject()); } return; } size = objectInput.readInt(); for (int i = 0; i < size; i++) { set(i, (IExpr) objectInput.readObject()); } }
/** * Create a new abstract syntax tree (AST). * * @param head * the header expression of the function. If the ast represents a function like * <code>f[x,y], Sin[x],...</code>, the <code>head</code> will be an instance of type ISymbol. * */ public final static IASTMutable headAST0(final IExpr head) { return new AST0(head); }
public IAST removeFromEnd(int fromPosition) { if (fromPosition == 1) { return new AST0(arg0); } if (fromPosition == 2) { return this; } throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(fromPosition) + ", Size: " + size()); }
public IAST removeFromEnd(int fromPosition) { if (fromPosition == 1) { return new AST0(arg0); } if (fromPosition == 2) { return new AST1(arg0, arg1); } if (fromPosition == 3) { return this; } throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(fromPosition) + ", Size: " + size()); }
public IAST removeFromEnd(int fromPosition) { if (fromPosition == 1) { return new AST0(arg0); } if (fromPosition == 2) { return new AST1(arg0, arg1); } if (fromPosition == 3) { return new AST2(arg0, arg1, arg2); } if (fromPosition == 4) { return this; } throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(fromPosition) + ", Size: " + size()); }