/* This file was generated by SableCC (http://www.sablecc.org/). */
package net.sf.jame.contextfree.cfdg.node;
import java.util.*;
import net.sf.jame.contextfree.cfdg.analysis.*;
@SuppressWarnings("nls")
public final class ATileDeclaration extends PTileDeclaration
{
private TTile _tile_;
private TLCbkt _lCbkt_;
private final LinkedList<PTileAdjustment> _tileAdjustment_ = new LinkedList<PTileAdjustment>();
private TRCbkt _rCbkt_;
public ATileDeclaration()
{
// Constructor
}
public ATileDeclaration(
@SuppressWarnings("hiding") TTile _tile_,
@SuppressWarnings("hiding") TLCbkt _lCbkt_,
@SuppressWarnings("hiding") List<PTileAdjustment> _tileAdjustment_,
@SuppressWarnings("hiding") TRCbkt _rCbkt_)
{
// Constructor
setTile(_tile_);
setLCbkt(_lCbkt_);
setTileAdjustment(_tileAdjustment_);
setRCbkt(_rCbkt_);
}
@Override
public Object clone()
{
return new ATileDeclaration(
cloneNode(this._tile_),
cloneNode(this._lCbkt_),
cloneList(this._tileAdjustment_),
cloneNode(this._rCbkt_));
}
public void apply(Switch sw)
{
((Analysis) sw).caseATileDeclaration(this);
}
public TTile getTile()
{
return this._tile_;
}
public void setTile(TTile node)
{
if(this._tile_ != null)
{
this._tile_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._tile_ = node;
}
public TLCbkt getLCbkt()
{
return this._lCbkt_;
}
public void setLCbkt(TLCbkt node)
{
if(this._lCbkt_ != null)
{
this._lCbkt_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._lCbkt_ = node;
}
public LinkedList<PTileAdjustment> getTileAdjustment()
{
return this._tileAdjustment_;
}
public void setTileAdjustment(List<PTileAdjustment> list)
{
this._tileAdjustment_.clear();
this._tileAdjustment_.addAll(list);
for(PTileAdjustment e : list)
{
if(e.parent() != null)
{
e.parent().removeChild(e);
}
e.parent(this);
}
}
public TRCbkt getRCbkt()
{
return this._rCbkt_;
}
public void setRCbkt(TRCbkt node)
{
if(this._rCbkt_ != null)
{
this._rCbkt_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._rCbkt_ = node;
}
@Override
public String toString()
{
return ""
+ toString(this._tile_)
+ toString(this._lCbkt_)
+ toString(this._tileAdjustment_)
+ toString(this._rCbkt_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._tile_ == child)
{
this._tile_ = null;
return;
}
if(this._lCbkt_ == child)
{
this._lCbkt_ = null;
return;
}
if(this._tileAdjustment_.remove(child))
{
return;
}
if(this._rCbkt_ == child)
{
this._rCbkt_ = null;
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._tile_ == oldChild)
{
setTile((TTile) newChild);
return;
}
if(this._lCbkt_ == oldChild)
{
setLCbkt((TLCbkt) newChild);
return;
}
for(ListIterator<PTileAdjustment> i = this._tileAdjustment_.listIterator(); i.hasNext();)
{
if(i.next() == oldChild)
{
if(newChild != null)
{
i.set((PTileAdjustment) newChild);
newChild.parent(this);
oldChild.parent(null);
return;
}
i.remove();
oldChild.parent(null);
return;
}
}
if(this._rCbkt_ == oldChild)
{
setRCbkt((TRCbkt) newChild);
return;
}
throw new RuntimeException("Not a child.");
}
}