00001 package edu.ksu.cis.bandera.birp.node;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 import ca.mcgill.sable.util.*;
00037 import edu.ksu.cis.bandera.birp.analysis.*;
00038
00039 public final class X1PPredicate extends XPPredicate
00040 {
00041 private XPPredicate _xPPredicate_;
00042 private PPredicate _pPredicate_;
00043
00044 public X1PPredicate()
00045 {
00046 }
00047 public X1PPredicate(
00048 XPPredicate _xPPredicate_,
00049 PPredicate _pPredicate_)
00050 {
00051 setXPPredicate(_xPPredicate_);
00052 setPPredicate(_pPredicate_);
00053 }
00054 public void apply(Switch sw)
00055 {
00056 throw new RuntimeException("Switch not supported.");
00057 }
00058 public Object clone()
00059 {
00060 throw new RuntimeException("Unsupported Operation");
00061 }
00062 public PPredicate getPPredicate()
00063 {
00064 return _pPredicate_;
00065 }
00066 public XPPredicate getXPPredicate()
00067 {
00068 return _xPPredicate_;
00069 }
00070 void removeChild(Node child)
00071 {
00072 if(_xPPredicate_ == child)
00073 {
00074 _xPPredicate_ = null;
00075 }
00076
00077 if(_pPredicate_ == child)
00078 {
00079 _pPredicate_ = null;
00080 }
00081 }
00082 void replaceChild(Node oldChild, Node newChild)
00083 {
00084 }
00085 public void setPPredicate(PPredicate node)
00086 {
00087 if(_pPredicate_ != null)
00088 {
00089 _pPredicate_.parent(null);
00090 }
00091
00092 if(node != null)
00093 {
00094 if(node.parent() != null)
00095 {
00096 node.parent().removeChild(node);
00097 }
00098
00099 node.parent(this);
00100 }
00101
00102 _pPredicate_ = node;
00103 }
00104 public void setXPPredicate(XPPredicate node)
00105 {
00106 if(_xPPredicate_ != null)
00107 {
00108 _xPPredicate_.parent(null);
00109 }
00110
00111 if(node != null)
00112 {
00113 if(node.parent() != null)
00114 {
00115 node.parent().removeChild(node);
00116 }
00117
00118 node.parent(this);
00119 }
00120
00121 _xPPredicate_ = node;
00122 }
00123 public String toString()
00124 {
00125 return "" +
00126 toString(_xPPredicate_) +
00127 toString(_pPredicate_);
00128 }
00129 }