
prerna.sablecc2.node.ARelationColDef Maven / Gradle / Ivy
The newest version!
/* This file was generated by SableCC (http://www.sablecc.org/). */
package prerna.sablecc2.node;
import prerna.sablecc2.analysis.*;
@SuppressWarnings("nls")
public final class ARelationColDef extends PColDef
{
private PRelationship _relationship_;
public ARelationColDef()
{
// Constructor
}
public ARelationColDef(
@SuppressWarnings("hiding") PRelationship _relationship_)
{
// Constructor
setRelationship(_relationship_);
}
@Override
public Object clone()
{
return new ARelationColDef(
cloneNode(this._relationship_));
}
@Override
public void apply(Switch sw)
{
((Analysis) sw).caseARelationColDef(this);
}
public PRelationship getRelationship()
{
return this._relationship_;
}
public void setRelationship(PRelationship node)
{
if(this._relationship_ != null)
{
this._relationship_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._relationship_ = node;
}
@Override
public String toString()
{
return ""
+ toString(this._relationship_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._relationship_ == child)
{
this._relationship_ = null;
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._relationship_ == oldChild)
{
setRelationship((PRelationship) newChild);
return;
}
throw new RuntimeException("Not a child.");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy