package pag.node.alloc;

import driver.PTAOptions;
import pag.PAG;
import soot.RefType;
import soot.SootMethod;
import soot.Type;

/**represent a parm/global/retarget followed by a set of Operations*/
public class SummaryNode extends Alloc_Node{
	
	public SummaryNode(PAG pag, Object rp, Type t, SootMethod m) {
		super(pag, rp, t, m);
		setPartial(rp,t);
	}
	
	private void setPartial(Object rp, Type t) {
        if(rp instanceof Alloc_Node) {
            partial = true;
            return;
        }
        if (PTAOptions.checkSignature) {
            if(t instanceof RefType rt && rt.getSootClass().isFinal()) {
                partial = true;
                return;
            }
        }
    }
	
	@Override
	public String toString() {
		return "SummaryNode{"+newExpr+"}";
	}
	
	private boolean partial = false;
    public boolean isPartial(){
        return partial;
    }
}
