org.geolatte.common.cql.node.ADuringExpr Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geolatte-common Show documentation
Show all versions of geolatte-common Show documentation
This GeoLatte-common library contains the transformer framework and other common classes used by other
GeoLatte modules.
/* This file was generated by SableCC (http://www.sablecc.org/). */
package org.geolatte.common.cql.node;
import org.geolatte.common.cql.analysis.*;
@SuppressWarnings("nls")
public final class ADuringExpr extends PExpr
{
private PAttr _attr_;
private PTimespanLiteral _timeSpan_;
public ADuringExpr()
{
// Constructor
}
public ADuringExpr(
@SuppressWarnings("hiding") PAttr _attr_,
@SuppressWarnings("hiding") PTimespanLiteral _timeSpan_)
{
// Constructor
setAttr(_attr_);
setTimeSpan(_timeSpan_);
}
@Override
public Object clone()
{
return new ADuringExpr(
cloneNode(this._attr_),
cloneNode(this._timeSpan_));
}
public void apply(Switch sw)
{
((Analysis) sw).caseADuringExpr(this);
}
public PAttr getAttr()
{
return this._attr_;
}
public void setAttr(PAttr node)
{
if(this._attr_ != null)
{
this._attr_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._attr_ = node;
}
public PTimespanLiteral getTimeSpan()
{
return this._timeSpan_;
}
public void setTimeSpan(PTimespanLiteral node)
{
if(this._timeSpan_ != null)
{
this._timeSpan_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._timeSpan_ = node;
}
@Override
public String toString()
{
return ""
+ toString(this._attr_)
+ toString(this._timeSpan_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._attr_ == child)
{
this._attr_ = null;
return;
}
if(this._timeSpan_ == child)
{
this._timeSpan_ = null;
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._attr_ == oldChild)
{
setAttr((PAttr) newChild);
return;
}
if(this._timeSpan_ == oldChild)
{
setTimeSpan((PTimespanLiteral) newChild);
return;
}
throw new RuntimeException("Not a child.");
}
}