/************************************************************************
*
* BeforeAfter.java
*
* Copyright: 2002-2011 by Henrik Just
*
* This file is part of Writer2LaTeX.
*
* Writer2LaTeX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Writer2LaTeX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Writer2LaTeX. If not, see
Add data to the BeforeAfter
The new data will be be added "inside", thus for example
*add("\textsf{","}");
* add("\textit{","}");
will create the pair \textsf{\textit{
, }}
Add data to the BeforeAfter
The new data will be be added "outside", thus for example
*enclose("\textsf{","}");
* enclose("\textit{","}");
will create the pair \textit{\textsf{
, }}
Add the content of another BeforeAfter
to this BeforeAfter
The new data will be be added "inside"
* * @param ba the code to add */ public void add(BeforeAfter ba) { add(ba.getBefore(), ba.getAfter()); } /** Get LaTeX code to put before * @return then LaTeX code */ public String getBefore() { return sBefore; } /** Get LaTeX code to put after * @return then LaTeX code */ public String getAfter() { return sAfter; } /** Check if thisBeforeAfter
contains any data
* @return true if there is data in at least one part
*/
public boolean isEmpty() { return sBefore.length()==0 && sAfter.length()==0; }
}