/* XBN Java: Generically useful, non-GUI Java code. http://sourceforge.net/projects/xbnjava Copyright (C) 1997-2003, Jeff Epstein All rights reserved. Modifications: No Redistribution in binary form, with or without modifications, are permitted provided that the following conditions are met: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * If modifications are made to source code then this license should indicate that fact in the "Modifications" section above. * Neither the author, nor the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [NOTE: This license contains NO advertising clause.] */ package xbn.config; import xbn.XBNObject; import xbn.array.VWChar; import xbn.string.TrimChars; import xbn.string.TCInvisible; import xbn.string.UtilChar; import xbn.string.UtilSOB; import xbn.string.UtilString; import xbn.string.UtilStringBuffer; import xbn.string.escape.USConfig; import xbn.string.escape.UnescapeString; import java.util.Arrays; /**

A trivial class used to hold internal objects for CRLineAnalyzer. See CRLineAnalyzer.

Source code:  CRLAObjects.java

The purpose of this class is to prevent internal objects from being created and destroyed rapid-fire. The CRLineAnalyzer class itself is created and destroyed rapid-fire--once for each line in the source text. So instead of creating and destroying the objects needed internally in it, they are created and persistently exist in this class. This object as a whole is then passed (rapid fire) into CRLineAnalyzer.

@version 0.9b @author Jeff Epstein, http://sourceforge.net/projects/xbnjava. **/ public class CRLAObjects extends XBNObject { UtilChar uChar = new UtilChar(); UtilString uStr = new UtilString(); UtilStringBuffer uSB = new UtilStringBuffer(); UtilSOB uSOB = new UtilSOB(); CRConfig crc = null; UnescapeString usAll2BEsc = null; UnescapeString usAll2BEscNotVD = null; UnescapeString usVarDelims = null; TrimChars tcESChar = null; TCInvisible tci = new TCInvisible(); /**

Create a CRLAObjects.

@param cr_config The CRConfig. May not be null. **/ public CRLAObjects(CRConfig cr_config) { VWChar vwc = new VWChar(); vwc.addAPChar(cr_config.getAll2BEscNotVD()); vwc.addAPChar(cr_config.getCRCDelimiters().getVarDelimsAPC()); char[] ac = vwc.getAOChar(); Arrays.sort(ac); try { usAll2BEsc = new UnescapeString( new USConfig( cr_config.getCRCVariable().getCRCVUnescape().getEscapeChar(), ac, cr_config.getCRCVariable().getCRCVUnescape().getUSCIgnore())); } catch(NullPointerException npx) { throwAX("constructor: cr_config is null."); } usAll2BEscNotVD = new UnescapeString( new USConfig( cr_config.getCRCVariable().getCRCVUnescape().getEscapeChar(), cr_config.getAll2BEscNotVD().getAOCClone(), cr_config.getCRCVariable().getCRCVUnescape().getUSCIgnore())); usVarDelims = new UnescapeString( new USConfig( cr_config.getCRCVariable().getCRCVUnescape().getEscapeChar(), cr_config.getCRCDelimiters().getVarDelimsAPC().getAOCClone(), cr_config.getCRCVariable().getCRCVUnescape().getUSCIgnore())); if(cr_config.getCRCVariable().getCRCVTrim().doUseESChar()) { tcESChar = new TrimChars(new char[] {cr_config.getCRCVariable().getCRCVTrim().getESChar()}, cr_config.getCRCVariable().getCRCVUnescape().getEscapeChar()); } crc = cr_config; } }