org.geolatte.common.cql.node.ADefaultDatetimeLiteral 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 ADefaultDatetimeLiteral extends PDatetimeLiteral
{
private TDatetime _datetime_;
public ADefaultDatetimeLiteral()
{
// Constructor
}
public ADefaultDatetimeLiteral(
@SuppressWarnings("hiding") TDatetime _datetime_)
{
// Constructor
setDatetime(_datetime_);
}
@Override
public Object clone()
{
return new ADefaultDatetimeLiteral(
cloneNode(this._datetime_));
}
public void apply(Switch sw)
{
((Analysis) sw).caseADefaultDatetimeLiteral(this);
}
public TDatetime getDatetime()
{
return this._datetime_;
}
public void setDatetime(TDatetime node)
{
if(this._datetime_ != null)
{
this._datetime_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._datetime_ = node;
}
@Override
public String toString()
{
return ""
+ toString(this._datetime_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._datetime_ == child)
{
this._datetime_ = null;
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._datetime_ == oldChild)
{
setDatetime((TDatetime) newChild);
return;
}
throw new RuntimeException("Not a child.");
}
}