/* This file was generated by SableCC (http://www.sablecc.org/). */ package net.sourceforge.texlipse.bibparser.node; import java.util.*; import net.sourceforge.texlipse.bibparser.analysis.*; @SuppressWarnings("nls") public final class AEntrybraceEntry extends PEntry { private PEntryDef _entryDef_; private TIdentifier _identifier_; private final LinkedList<PKeyvalDecl> _keyvalDecl_ = new LinkedList<PKeyvalDecl>(); private TRBrace _rBrace_; public AEntrybraceEntry() { // Constructor } public AEntrybraceEntry( @SuppressWarnings("hiding") PEntryDef _entryDef_, @SuppressWarnings("hiding") TIdentifier _identifier_, @SuppressWarnings("hiding") List<PKeyvalDecl> _keyvalDecl_, @SuppressWarnings("hiding") TRBrace _rBrace_) { // Constructor setEntryDef(_entryDef_); setIdentifier(_identifier_); setKeyvalDecl(_keyvalDecl_); setRBrace(_rBrace_); } @Override public Object clone() { return new AEntrybraceEntry( cloneNode(this._entryDef_), cloneNode(this._identifier_), cloneList(this._keyvalDecl_), cloneNode(this._rBrace_)); } public void apply(Switch sw) { ((Analysis) sw).caseAEntrybraceEntry(this); } public PEntryDef getEntryDef() { return this._entryDef_; } public void setEntryDef(PEntryDef node) { if(this._entryDef_ != null) { this._entryDef_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._entryDef_ = node; } public TIdentifier getIdentifier() { return this._identifier_; } public void setIdentifier(TIdentifier node) { if(this._identifier_ != null) { this._identifier_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._identifier_ = node; } public LinkedList<PKeyvalDecl> getKeyvalDecl() { return this._keyvalDecl_; } public void setKeyvalDecl(List<PKeyvalDecl> list) { this._keyvalDecl_.clear(); this._keyvalDecl_.addAll(list); for(PKeyvalDecl e : list) { if(e.parent() != null) { e.parent().removeChild(e); } e.parent(this); } } public TRBrace getRBrace() { return this._rBrace_; } public void setRBrace(TRBrace node) { if(this._rBrace_ != null) { this._rBrace_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._rBrace_ = node; } @Override public String toString() { return "" + toString(this._entryDef_) + toString(this._identifier_) + toString(this._keyvalDecl_) + toString(this._rBrace_); } @Override void removeChild(@SuppressWarnings("unused") Node child) { // Remove child if(this._entryDef_ == child) { this._entryDef_ = null; return; } if(this._identifier_ == child) { this._identifier_ = null; return; } if(this._keyvalDecl_.remove(child)) { return; } if(this._rBrace_ == child) { this._rBrace_ = null; return; } throw new RuntimeException("Not a child."); } @Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._entryDef_ == oldChild) { setEntryDef((PEntryDef) newChild); return; } if(this._identifier_ == oldChild) { setIdentifier((TIdentifier) newChild); return; } for(ListIterator<PKeyvalDecl> i = this._keyvalDecl_.listIterator(); i.hasNext();) { if(i.next() == oldChild) { if(newChild != null) { i.set((PKeyvalDecl) newChild); newChild.parent(this); oldChild.parent(null); return; } i.remove(); oldChild.parent(null); return; } } if(this._rBrace_ == oldChild) { setRBrace((TRBrace) newChild); return; } throw new RuntimeException("Not a child."); } }