/* 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.string.padchop; import xbn.XBNObject; /**
Part of PCSConfig that configures chop-specific items. See PCSConfig.
Source code: SpcfcCfgChop.java
Create a SpcfcCfgChop with default settings.
Equal to SpcfcCfgChop(true)
Create a SpcfcCfgChop.
Equal to SpcfcCfgChop(b_chopEndStart, null)
Create a SpcfcCfgChop.
Equal to SpcfcCfgChop(true, s_chopDotDotDot)
Create a SpcfcCfgChop.
Equal to SpcfcCfgChop(b_chopEndStart, s_chopDotDotDot, 0)
Create a SpcfcCfgChop.
@param b_chopEndStart When the string needs to be chopped, which end should it happen to? See getChopSideEndStart. @param s_chopDotDotDot The chop ellipsis text. If non-null, must be at least one character in length. If null, no ellipsis is used (i_cdddFlush is ignored). See getChopDotDotDot. Note that the chop ellipsis is only used when the text is actually chopped, regardless the value of i_cdddFlush. @param i_cdddFlush The number of ellipsis characters that should be "sticking out" of the chopped text. Must be between zero and [length of s_chopDotDotDot] inclusive, where zero is perfectly flushed (completely contained in the chopped string text) and [length of s_chopDotDotDot] is concatenated to the chopped string. If s_chopDotDotDot is null, this parameter is ignored. See getCDDDFlush. **/ public SpcfcCfgChop(boolean b_chopEndStart, String s_chopDotDotDot, int i_cdddFlush) { if(s_chopDotDotDot != null) { throwAXIfBadStr(s_chopDotDotDot, "s_chopDotDotDot", sCNSTR); if(i_cdddFlush < 0 || i_cdddFlush > s_chopDotDotDot.length()) { throwAX("constructor: i_cdddFlush must be between zero and s_chopDotDotDot.length() (" + s_chopDotDotDot.length() + "), inclusive. Currently " + i_cdddFlush + "."); } } bChopEndOrStart = b_chopEndStart; sChopDotDotDot = s_chopDotDotDot; iCDDDFlush = i_cdddFlush; } /**When the string needs to be chopped, which end should it happen to?
@return b_chopEndStart exactly as provided to the constructor. **/ public final boolean getChopSideEndStart() { return bChopEndOrStart; } /**When chopping should there be an ellipsis, indicating that the text was, in fact, chopped?. See getCDDDFlush.
@return s_chopDotDotDot exactly as provided to the constructor. **/ public final String getChopDotDotDot() { return sChopDotDotDot; } /**Get the chop ellipsis flush setting. See getChopDotDotDot.
@return i_cdddFlush exactly as provided to the constructor. **/ public final int getCDDDFlush() { return iCDDDFlush; } /**Get some information about this SpcfcCfgChop.
**/ public String toString() { return this.getClass().getName() + ": getChopSideEndStart()=" + getChopSideEndStart() + ", getChopDotDotDot()='" + getChopDotDotDot() + "', getCDDDFlush()=" + getCDDDFlush(); } }