![JAR search and dependency download from the Maven repository](/logo.png)
org.geolatte.common.cql.node.ADurationToTimespanLiteral 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 ADurationToTimespanLiteral extends PTimespanLiteral
{
private PDurationLiteral _duration_;
private TDatetime _to_;
public ADurationToTimespanLiteral()
{
// Constructor
}
public ADurationToTimespanLiteral(
@SuppressWarnings("hiding") PDurationLiteral _duration_,
@SuppressWarnings("hiding") TDatetime _to_)
{
// Constructor
setDuration(_duration_);
setTo(_to_);
}
@Override
public Object clone()
{
return new ADurationToTimespanLiteral(
cloneNode(this._duration_),
cloneNode(this._to_));
}
public void apply(Switch sw)
{
((Analysis) sw).caseADurationToTimespanLiteral(this);
}
public PDurationLiteral getDuration()
{
return this._duration_;
}
public void setDuration(PDurationLiteral node)
{
if(this._duration_ != null)
{
this._duration_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._duration_ = node;
}
public TDatetime getTo()
{
return this._to_;
}
public void setTo(TDatetime node)
{
if(this._to_ != null)
{
this._to_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._to_ = node;
}
@Override
public String toString()
{
return ""
+ toString(this._duration_)
+ toString(this._to_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._duration_ == child)
{
this._duration_ = null;
return;
}
if(this._to_ == child)
{
this._to_ = null;
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._duration_ == oldChild)
{
setDuration((PDurationLiteral) newChild);
return;
}
if(this._to_ == oldChild)
{
setTo((TDatetime) newChild);
return;
}
throw new RuntimeException("Not a child.");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy