| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>CharSequences (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <meta name="keywords" content="org.apache.sis.util.CharSequences class"> |
| <meta name="keywords" content="EMPTY_ARRAY"> |
| <meta name="keywords" content="spaces()"> |
| <meta name="keywords" content="length()"> |
| <meta name="keywords" content="codePointCount()"> |
| <meta name="keywords" content="count()"> |
| <meta name="keywords" content="indexOf()"> |
| <meta name="keywords" content="lastIndexOf()"> |
| <meta name="keywords" content="indexOfLineStart()"> |
| <meta name="keywords" content="skipLeadingWhitespaces()"> |
| <meta name="keywords" content="skipTrailingWhitespaces()"> |
| <meta name="keywords" content="split()"> |
| <meta name="keywords" content="splitOnEOL()"> |
| <meta name="keywords" content="parseDoubles()"> |
| <meta name="keywords" content="parseFloats()"> |
| <meta name="keywords" content="parseLongs()"> |
| <meta name="keywords" content="parseInts()"> |
| <meta name="keywords" content="parseShorts()"> |
| <meta name="keywords" content="parseBytes()"> |
| <meta name="keywords" content="toASCII()"> |
| <meta name="keywords" content="trimWhitespaces()"> |
| <meta name="keywords" content="trimFractionalPart()"> |
| <meta name="keywords" content="shortSentence()"> |
| <meta name="keywords" content="upperCaseToSentence()"> |
| <meta name="keywords" content="camelCaseToSentence()"> |
| <meta name="keywords" content="camelCaseToWords()"> |
| <meta name="keywords" content="camelCaseToAcronym()"> |
| <meta name="keywords" content="isAcronymForWords()"> |
| <meta name="keywords" content="isUnicodeIdentifier()"> |
| <meta name="keywords" content="isUpperCase()"> |
| <meta name="keywords" content="equalsFiltered()"> |
| <meta name="keywords" content="equalsIgnoreCase()"> |
| <meta name="keywords" content="equals()"> |
| <meta name="keywords" content="regionMatches()"> |
| <meta name="keywords" content="startsWith()"> |
| <meta name="keywords" content="endsWith()"> |
| <meta name="keywords" content="commonPrefix()"> |
| <meta name="keywords" content="commonSuffix()"> |
| <meta name="keywords" content="token()"> |
| <meta name="keywords" content="replace()"> |
| <meta name="keywords" content="copyChars()"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="CharSequences (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9,"i21":9,"i22":9,"i23":9,"i24":9,"i25":9,"i26":9,"i27":9,"i28":9,"i29":9,"i30":9,"i31":9,"i32":9,"i33":9,"i34":9,"i35":9,"i36":9,"i37":9,"i38":9,"i39":9,"i40":9,"i41":9,"i42":9,"i43":9,"i44":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/CharSequences.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.sis.util</a></div> |
| <h2 title="Class CharSequences" class="title">Class CharSequences</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="Static.html" title="class in org.apache.sis.util">Static</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>CharSequences</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public final class <span class="typeNameLabel">CharSequences</span> |
| extends <a href="Static.html" title="class in org.apache.sis.util">Static</a></pre> |
| <div class="block">Static methods working with <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>CharSequence</code></a> instances. Some methods defined in this |
| class duplicate the functionalities already provided in the standard <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>String</code></a> class, |
| but works on a generic <code>CharSequence</code> instance instead than <code>String</code>. |
| |
| <div class="section">Unicode support</div> |
| Every methods defined in this class work on <cite>code points</cite> instead than characters |
| when appropriate. Consequently those methods should behave correctly with characters outside |
| the <cite>Basic Multilingual Plane</cite> (BMP). |
| |
| <div class="section">Policy on space characters</div> |
| Java defines two methods for testing if a character is a white space: |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isWhitespace(int)" title="class or interface in java.lang" class="externalLink"><code>Character.isWhitespace(int)</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isSpaceChar(int)" title="class or interface in java.lang" class="externalLink"><code>Character.isSpaceChar(int)</code></a>. |
| Those two methods differ in the way they handle <a href="Characters.html#NO_BREAK_SPACE">no-break spaces</a>, tabulations and line feeds. The general policy in the SIS library is: |
| |
| <ul> |
| <li>Use <code>isWhitespace(…)</code> when separating entities (words, numbers, tokens, <i>etc.</i>) |
| in a list. Using that method, characters separated by a no-break space are considered as |
| part of the same entity.</li> |
| <li>Use <code>isSpaceChar(…)</code> when parsing a single entity, for example a single word. |
| Using this method, no-break spaces are considered as part of the entity while line |
| feeds or tabulations are entity boundaries.</li> |
| </ul> |
| |
| <div class="note"><b>Example:</b> |
| Numbers formatted in the French locale use no-break spaces as group separators. When parsing a list of numbers, |
| ordinary spaces around the numbers may need to be ignored, but no-break spaces shall be considered as part of the |
| numbers. Consequently <code>isWhitespace(…)</code> is appropriate for skipping spaces <em>between</em> the numbers. |
| But if there is spaces to skip <em>inside</em> a single number, then <code>isSpaceChar(…)</code> is a good choice |
| for accepting no-break spaces and for stopping the parse operation at tabulations or line feed character. |
| A tabulation or line feed between two characters is very likely to separate two distinct values.</div> |
| |
| In practice, the <a href="https://docs.oracle.com/javase/8/docs/api/java/text/Format.html?is-external=true" title="class or interface in java.text" class="externalLink"><code>Format</code></a> implementations in the SIS library typically use |
| <code>isSpaceChar(…)</code> while most of the rest of the SIS library, including this |
| <code>CharSequences</code> class, consistently uses <code>isWhitespace(…)</code>. |
| |
| <p>Note that the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#trim()" title="class or interface in java.lang" class="externalLink"><code>String.trim()</code></a> method doesn't follow any of those policies and should |
| generally be avoided. That <code>trim()</code> method removes every ISO control characters without |
| distinction about whether the characters are space or not, and ignore all Unicode spaces. |
| The <a href="#trimWhitespaces(java.lang.String)"><code>trimWhitespaces(String)</code></a> method defined in this class can be used as an alternative.</p> |
| |
| <div class="section">Handling of null values</div> |
| Most methods in this class accept a <code>null</code> <code>CharSequence</code> argument. In such cases |
| the method return value is either a <code>null</code> <code>CharSequence</code>, an empty array, or a |
| <code>0</code> or <code>false</code> primitive type calculated as if the input was an empty string.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.3</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="StringBuilders.html" title="class in org.apache.sis.util"><code>StringBuilders</code></a></dd> |
| |
| <p><font size="-1">Defined in the <code>sis-utility</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#EMPTY_ARRAY">EMPTY_ARRAY</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">An array of zero-length.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#camelCaseToAcronym(java.lang.CharSequence)">camelCaseToAcronym</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates an acronym from the given text.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#camelCaseToSentence(java.lang.CharSequence)">camelCaseToSentence</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier)</code></th> |
| <td class="colLast"> |
| <div class="block">Given a string in camel cases (typically an identifier), returns a string formatted |
| like an English sentence.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#camelCaseToWords(java.lang.CharSequence,boolean)">camelCaseToWords</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier, |
| boolean toLowerCase)</code></th> |
| <td class="colLast"> |
| <div class="block">Given a string in camel cases, returns a string with the same words separated by spaces.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#codePointCount(java.lang.CharSequence)">codePointCount</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of Unicode code points in the given characters sequence, |
| or 0 if <code>null</code>.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#codePointCount(java.lang.CharSequence,int,int)">codePointCount</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| int toIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of Unicode code points in the given characters sub-sequence, |
| or 0 if <code>null</code>.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#commonPrefix(java.lang.CharSequence,java.lang.CharSequence)">commonPrefix</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the longest sequence of characters which is found at the beginning of the two |
| given texts.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#commonSuffix(java.lang.CharSequence,java.lang.CharSequence)">commonSuffix</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the longest sequence of characters which is found at the end of the two given texts.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copyChars(java.lang.CharSequence,int,char%5B%5D,int,int)">copyChars</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> src, |
| int srcOffset, |
| char[] dst, |
| int dstOffset, |
| int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Copies a sequence of characters in the given <code>char[]</code> array.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#count(java.lang.CharSequence,char)">count</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| char toSearch)</code></th> |
| <td class="colLast"> |
| <div class="block">Counts the number of occurrence of the given character in the given character sequence.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#count(java.lang.CharSequence,java.lang.String)">count</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> toSearch)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of occurrences of the <code>toSearch</code> string in the given <code>text</code>.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#endsWith(java.lang.CharSequence,java.lang.CharSequence,boolean)">endsWith</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> suffix, |
| boolean ignoreCase)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given character sequence ends with the given suffix.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.CharSequence,java.lang.CharSequence)">equals</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the two given texts are equal.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equalsFiltered(java.lang.CharSequence,java.lang.CharSequence,org.apache.sis.util.Characters.Filter,boolean)">equalsFiltered</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2, |
| <a href="Characters.Filter.html" title="class in org.apache.sis.util">Characters.Filter</a> filter, |
| boolean ignoreCase)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given texts are equal, optionally ignoring case and filtered-out characters.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equalsIgnoreCase(java.lang.CharSequence,java.lang.CharSequence)">equalsIgnoreCase</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the two given texts are equal, ignoring case.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#indexOf(java.lang.CharSequence,int,int,int)">indexOf</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int toSearch, |
| int fromIndex, |
| int toIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the index within the given character sequence of the first occurrence of the |
| specified character, starting the search at the specified index.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#indexOf(java.lang.CharSequence,java.lang.CharSequence,int,int)">indexOf</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> toSearch, |
| int fromIndex, |
| int toIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the index within the given strings of the first occurrence of the specified part, |
| starting at the specified index.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#indexOfLineStart(java.lang.CharSequence,int,int)">indexOfLineStart</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int numLines, |
| int fromIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the index of the first character after the given number of lines.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAcronymForWords(java.lang.CharSequence,java.lang.CharSequence)">isAcronymForWords</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> acronym, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> words)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the first string is likely to be an acronym of the second string.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isUnicodeIdentifier(java.lang.CharSequence)">isUnicodeIdentifier</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given identifier is a legal Unicode identifier.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isUpperCase(java.lang.CharSequence)">isUpperCase</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given text is non-null, contains at least one upper-case character and |
| no lower-case character.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#lastIndexOf(java.lang.CharSequence,int,int,int)">lastIndexOf</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int toSearch, |
| int fromIndex, |
| int toIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the index within the given character sequence of the last occurrence of the |
| specified character, searching backward in the given index range.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#length(java.lang.CharSequence)">length</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true#length()" title="class or interface in java.lang" class="externalLink">length</a> of the given characters sequence, |
| or 0 if <code>null</code>.</div> |
| </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseBytes(java.lang.CharSequence,char,int)">parseBytes</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix)</code></th> |
| <td class="colLast"> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Byte.html?is-external=true#parseByte(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>byte</code>.</div> |
| </td> |
| </tr> |
| <tr id="i23" class="rowColor"> |
| <td class="colFirst"><code>static double[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseDoubles(java.lang.CharSequence,char)">parseDoubles</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator)</code></th> |
| <td class="colLast"> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#parseDouble(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>double</code>.</div> |
| </td> |
| </tr> |
| <tr id="i24" class="altColor"> |
| <td class="colFirst"><code>static float[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseFloats(java.lang.CharSequence,char)">parseFloats</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator)</code></th> |
| <td class="colLast"> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html?is-external=true#parseFloat(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>float</code>.</div> |
| </td> |
| </tr> |
| <tr id="i25" class="rowColor"> |
| <td class="colFirst"><code>static int[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseInts(java.lang.CharSequence,char,int)">parseInts</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix)</code></th> |
| <td class="colLast"> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true#parseInt(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as an <code>int</code>.</div> |
| </td> |
| </tr> |
| <tr id="i26" class="altColor"> |
| <td class="colFirst"><code>static long[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseLongs(java.lang.CharSequence,char,int)">parseLongs</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix)</code></th> |
| <td class="colLast"> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true#parseLong(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>long</code>.</div> |
| </td> |
| </tr> |
| <tr id="i27" class="rowColor"> |
| <td class="colFirst"><code>static short[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseShorts(java.lang.CharSequence,char,int)">parseShorts</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix)</code></th> |
| <td class="colLast"> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Short.html?is-external=true#parseShort(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>short</code>.</div> |
| </td> |
| </tr> |
| <tr id="i28" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#regionMatches(java.lang.CharSequence,int,java.lang.CharSequence)">regionMatches</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> part)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given text at the given offset contains the given part, |
| in a case-sensitive comparison.</div> |
| </td> |
| </tr> |
| <tr id="i29" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#regionMatches(java.lang.CharSequence,int,java.lang.CharSequence,boolean)">regionMatches</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> part, |
| boolean ignoreCase)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given text at the given offset contains the given part, |
| optionally in a case-insensitive way.</div> |
| </td> |
| </tr> |
| <tr id="i30" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replace(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)">replace</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> toSearch, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> replaceBy)</code></th> |
| <td class="colLast"> |
| <div class="block">Replaces all occurrences of a given string in the given character sequence.</div> |
| </td> |
| </tr> |
| <tr id="i31" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shortSentence(java.lang.CharSequence,int)">shortSentence</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int maxLength)</code></th> |
| <td class="colLast"> |
| <div class="block">Makes sure that the <code>text</code> string is not longer than <code>maxLength</code> characters.</div> |
| </td> |
| </tr> |
| <tr id="i32" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#skipLeadingWhitespaces(java.lang.CharSequence,int,int)">skipLeadingWhitespaces</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| int toIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the index of the first non-white character in the given range.</div> |
| </td> |
| </tr> |
| <tr id="i33" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#skipTrailingWhitespaces(java.lang.CharSequence,int,int)">skipTrailingWhitespaces</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| int toIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the index <em>after</em> the last non-white character in the given range.</div> |
| </td> |
| </tr> |
| <tr id="i34" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#spaces(int)">spaces</a></span>​(int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a character sequence of the specified length filled with white spaces.</div> |
| </td> |
| </tr> |
| <tr id="i35" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a>[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#split(java.lang.CharSequence,char)">split</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| char separator)</code></th> |
| <td class="colLast"> |
| <div class="block">Splits a text around the given character.</div> |
| </td> |
| </tr> |
| <tr id="i36" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a>[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#splitOnEOL(java.lang.CharSequence)">splitOnEOL</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Splits a text around the <cite>End Of Line</cite> (EOL) characters.</div> |
| </td> |
| </tr> |
| <tr id="i37" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#startsWith(java.lang.CharSequence,java.lang.CharSequence,boolean)">startsWith</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> prefix, |
| boolean ignoreCase)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given character sequence starts with the given prefix.</div> |
| </td> |
| </tr> |
| <tr id="i38" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toASCII(java.lang.CharSequence)">toASCII</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Replaces some Unicode characters by ASCII characters on a "best effort basis".</div> |
| </td> |
| </tr> |
| <tr id="i39" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#token(java.lang.CharSequence,int)">token</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the token starting at the given offset in the given text.</div> |
| </td> |
| </tr> |
| <tr id="i40" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#trimFractionalPart(java.lang.CharSequence)">trimFractionalPart</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Trims the fractional part of the given formatted number, provided that it doesn't change |
| the value.</div> |
| </td> |
| </tr> |
| <tr id="i41" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#trimWhitespaces(java.lang.CharSequence)">trimWhitespaces</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a text with leading and trailing whitespace characters omitted.</div> |
| </td> |
| </tr> |
| <tr id="i42" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#trimWhitespaces(java.lang.CharSequence,int,int)">trimWhitespaces</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int lower, |
| int upper)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a sub-sequence with leading and trailing whitespace characters omitted.</div> |
| </td> |
| </tr> |
| <tr id="i43" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#trimWhitespaces(java.lang.String)">trimWhitespaces</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> text)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a string with leading and trailing whitespace characters omitted.</div> |
| </td> |
| </tr> |
| <tr id="i44" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#upperCaseToSentence(java.lang.CharSequence)">upperCaseToSentence</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier)</code></th> |
| <td class="colLast"> |
| <div class="block">Given a string in upper cases (typically a Java constant), returns a string formatted |
| like an English sentence.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="EMPTY_ARRAY"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>EMPTY_ARRAY</h4> |
| <pre>public static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>[] EMPTY_ARRAY</pre> |
| <div class="block">An array of zero-length. This constant play a role equivalents to |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html?is-external=true#EMPTY_LIST" title="class or interface in java.util" class="externalLink"><code>Collections.EMPTY_LIST</code></a>.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="spaces(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>spaces</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> spaces​(int length)</pre> |
| <div class="block">Returns a character sequence of the specified length filled with white spaces. |
| |
| <div class="section">Use case</div> |
| This method is typically invoked for performing right-alignment of text on the |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Console.html?is-external=true" title="class or interface in java.io" class="externalLink">console</a> or other device using monospaced font. |
| Callers compute a value for the <code>length</code> argument by (<var>desired width</var> - <var>used width</var>). |
| Since the <var>used width</var> value may be greater than expected, this method handle negative <code>length</code> |
| values as if the value was zero.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>length</code> - the string length. Negative values are clamped to 0.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a string of length <code>length</code> filled with white spaces.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="length(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>length</h4> |
| <pre class="methodSignature">public static int length​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</pre> |
| <div class="block">Returns the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true#length()" title="class or interface in java.lang" class="externalLink">length</a> of the given characters sequence, |
| or 0 if <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence from which to get the length, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the length of the character sequence, or 0 if the argument is <code>null</code>.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="codePointCount(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>codePointCount</h4> |
| <pre class="methodSignature">public static int codePointCount​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</pre> |
| <div class="block">Returns the number of Unicode code points in the given characters sequence, |
| or 0 if <code>null</code>. Unpaired surrogates within the text count as one code |
| point each.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence from which to get the count, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of Unicode code points, or 0 if the argument is <code>null</code>.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#codePointCount(java.lang.CharSequence,int,int)"><code>codePointCount(CharSequence, int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="codePointCount(java.lang.CharSequence,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>codePointCount</h4> |
| <pre class="methodSignature">public static int codePointCount​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| int toIndex)</pre> |
| <div class="block">Returns the number of Unicode code points in the given characters sub-sequence, |
| or 0 if <code>null</code>. Unpaired surrogates within the text count as one code |
| point each. |
| |
| <p>This method performs the same work than the standard |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#codePointCount(java.lang.CharSequence,int,int)" title="class or interface in java.lang" class="externalLink"><code>Character.codePointCount(CharSequence, int, int)</code></a> method, except that it tries |
| to delegate to the optimized methods from the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>String</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>StringBuilder</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuffer.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>StringBuffer</code></a> or <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/CharBuffer.html?is-external=true" title="class or interface in java.nio" class="externalLink"><code>CharBuffer</code></a> classes if possible.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence from which to get the count, or <code>null</code>.</dd> |
| <dd><code>fromIndex</code> - the index from which to start the computation.</dd> |
| <dd><code>toIndex</code> - the index after the last character to take in account.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of Unicode code points, or 0 if the argument is <code>null</code>.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#codePointCount(java.lang.CharSequence,int,int)" title="class or interface in java.lang" class="externalLink"><code>Character.codePointCount(CharSequence, int, int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#codePointCount(int,int)" title="class or interface in java.lang" class="externalLink"><code>String.codePointCount(int, int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true#codePointCount(int,int)" title="class or interface in java.lang" class="externalLink"><code>StringBuilder.codePointCount(int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="count(java.lang.CharSequence,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>count</h4> |
| <pre class="methodSignature">public static int count​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> toSearch)</pre> |
| <div class="block">Returns the number of occurrences of the <code>toSearch</code> string in the given <code>text</code>. |
| The search is case-sensitive.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence to count occurrences, or <code>null</code>.</dd> |
| <dd><code>toSearch</code> - the string to search in the given <code>text</code>. |
| It shall contain at least one character.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of occurrences of <code>toSearch</code> in <code>text</code>, |
| or 0 if <code>text</code> was null or empty.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="NullArgumentException.html" title="class in org.apache.sis.util">NullArgumentException</a></code> - if the <code>toSearch</code> argument is null.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the <code>toSearch</code> argument is empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="count(java.lang.CharSequence,char)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>count</h4> |
| <pre class="methodSignature">public static int count​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| char toSearch)</pre> |
| <div class="block">Counts the number of occurrence of the given character in the given character sequence.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence to count occurrences, or <code>null</code>.</dd> |
| <dd><code>toSearch</code> - the character to count.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of occurrences of the given character, or 0 if the <code>text</code> is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="indexOf(java.lang.CharSequence,java.lang.CharSequence,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>indexOf</h4> |
| <pre class="methodSignature">public static int indexOf​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> toSearch, |
| int fromIndex, |
| int toIndex)</pre> |
| <div class="block">Returns the index within the given strings of the first occurrence of the specified part, |
| starting at the specified index. This method is equivalent to the following method call, |
| except that this method works on arbitrary <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>CharSequence</code></a> objects instead than |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>String</code></a>s only, and that the upper limit can be specified: |
| |
| <blockquote><pre><font color="green">return</font> text.<b>indexOf</b>(part, fromIndex);</pre></blockquote> |
| |
| There is no restriction on the value of <code>fromIndex</code>. If negative or greater |
| than <code>toIndex</code>, then the behavior of this method is as if the search started |
| from 0 or <code>toIndex</code> respectively. This is consistent with the |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#indexOf(java.lang.String,int)" title="class or interface in java.lang" class="externalLink"><code>String.indexOf(String, int)</code></a> behavior.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the string in which to perform the search.</dd> |
| <dd><code>toSearch</code> - the substring for which to search.</dd> |
| <dd><code>fromIndex</code> - the index from which to start the search.</dd> |
| <dd><code>toIndex</code> - the index after the last character where to perform the search.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the index within the text of the first occurrence of the specified part, starting at the specified index, |
| or -1 if no occurrence has been found or if the <code>text</code> argument is null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="NullArgumentException.html" title="class in org.apache.sis.util">NullArgumentException</a></code> - if the <code>toSearch</code> argument is null.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the <code>toSearch</code> argument is empty.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#indexOf(java.lang.String,int)" title="class or interface in java.lang" class="externalLink"><code>String.indexOf(String, int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true#indexOf(java.lang.String,int)" title="class or interface in java.lang" class="externalLink"><code>StringBuilder.indexOf(String, int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuffer.html?is-external=true#indexOf(java.lang.String,int)" title="class or interface in java.lang" class="externalLink"><code>StringBuffer.indexOf(String, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="indexOf(java.lang.CharSequence,int,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>indexOf</h4> |
| <pre class="methodSignature">public static int indexOf​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int toSearch, |
| int fromIndex, |
| int toIndex)</pre> |
| <div class="block">Returns the index within the given character sequence of the first occurrence of the |
| specified character, starting the search at the specified index. If the character is |
| not found, then this method returns -1. |
| |
| <p>There is no restriction on the value of <code>fromIndex</code>. If negative or greater |
| than <code>toIndex</code>, then the behavior of this method is as if the search started |
| from 0 or <code>toIndex</code> respectively. This is consistent with the behavior documented |
| in <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#indexOf(int,int)" title="class or interface in java.lang" class="externalLink"><code>String.indexOf(int, int)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence in which to perform the search, or <code>null</code>.</dd> |
| <dd><code>toSearch</code> - the Unicode code point of the character to search.</dd> |
| <dd><code>fromIndex</code> - the index to start the search from.</dd> |
| <dd><code>toIndex</code> - the index after the last character where to perform the search.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the index of the first occurrence of the given character in the specified sub-sequence, |
| or -1 if no occurrence has been found or if the <code>text</code> argument is null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#indexOf(int,int)" title="class or interface in java.lang" class="externalLink"><code>String.indexOf(int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="lastIndexOf(java.lang.CharSequence,int,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>lastIndexOf</h4> |
| <pre class="methodSignature">public static int lastIndexOf​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int toSearch, |
| int fromIndex, |
| int toIndex)</pre> |
| <div class="block">Returns the index within the given character sequence of the last occurrence of the |
| specified character, searching backward in the given index range. |
| If the character is not found, then this method returns -1. |
| |
| <p>There is no restriction on the value of <code>toIndex</code>. If greater than the text length |
| or less than <code>fromIndex</code>, then the behavior of this method is as if the search started |
| from <code>length</code> or <code>fromIndex</code> respectively. This is consistent with the behavior |
| documented in <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#lastIndexOf(int,int)" title="class or interface in java.lang" class="externalLink"><code>String.lastIndexOf(int, int)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence in which to perform the search, or <code>null</code>.</dd> |
| <dd><code>toSearch</code> - the Unicode code point of the character to search.</dd> |
| <dd><code>fromIndex</code> - the index of the first character in the range where to perform the search.</dd> |
| <dd><code>toIndex</code> - the index after the last character in the range where to perform the search.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the index of the last occurrence of the given character in the specified sub-sequence, |
| or -1 if no occurrence has been found or if the <code>text</code> argument is null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#lastIndexOf(int,int)" title="class or interface in java.lang" class="externalLink"><code>String.lastIndexOf(int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="indexOfLineStart(java.lang.CharSequence,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>indexOfLineStart</h4> |
| <pre class="methodSignature">public static int indexOfLineStart​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int numLines, |
| int fromIndex)</pre> |
| <div class="block">Returns the index of the first character after the given number of lines. |
| This method counts the number of occurrence of <code>'\n'</code>, <code>'\r'</code> |
| or <code>"\r\n"</code> starting from the given position. When <code>numLines</code> |
| occurrences have been found, the index of the first character after the last |
| occurrence is returned. |
| |
| <p>If the <code>numLines</code> argument is positive, this method searches forward. |
| If negative, this method searches backward. If 0, this method returns the |
| beginning of the current line.</p> |
| |
| <p>If this method reaches the end of <code>text</code> while searching forward, then |
| <code>text.length()</code> is returned. If this method reaches the beginning of |
| <code>text</code> while searching backward, then 0 is returned.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the string in which to skip a determined amount of lines.</dd> |
| <dd><code>numLines</code> - the number of lines to skip. Can be positive, zero or negative.</dd> |
| <dd><code>fromIndex</code> - index at which to start the search, from 0 to <code>text.length()</code> inclusive.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>index of the first character after the last skipped line.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if the <code>text</code> argument is null.</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if <code>fromIndex</code> is out of bounds.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="skipLeadingWhitespaces(java.lang.CharSequence,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>skipLeadingWhitespaces</h4> |
| <pre class="methodSignature">public static int skipLeadingWhitespaces​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| int toIndex)</pre> |
| <div class="block">Returns the index of the first non-white character in the given range. |
| If the given range contains only space characters, then this method returns the index of the |
| first character after the given range, which is always equals or greater than <code>toIndex</code>. |
| Note that this character may not exist if <code>toIndex</code> is equals to the text length. |
| |
| <p>Special cases:</p> |
| <ul> |
| <li>If <code>fromIndex</code> is greater than <code>toIndex</code>, |
| then this method unconditionally returns <code>fromIndex</code>.</li> |
| <li>If the given range contains only space characters and the character at <code>toIndex-1</code> |
| is the high surrogate of a valid supplementary code point, then this method returns |
| <code>toIndex+1</code>, which is the index of the next code point.</li> |
| <li>If <code>fromIndex</code> is negative or <code>toIndex</code> is greater than the text length, |
| then the behavior of this method is undefined.</li> |
| </ul> |
| |
| Space characters are identified by the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isWhitespace(int)" title="class or interface in java.lang" class="externalLink"><code>Character.isWhitespace(int)</code></a> method.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the string in which to perform the search (can not be null).</dd> |
| <dd><code>fromIndex</code> - the index from which to start the search (can not be negative).</dd> |
| <dd><code>toIndex</code> - the index after the last character where to perform the search.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the index within the text of the first occurrence of a non-space character, starting |
| at the specified index, or a value equals or greater than <code>toIndex</code> if none.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if the <code>text</code> argument is null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#skipTrailingWhitespaces(java.lang.CharSequence,int,int)"><code>skipTrailingWhitespaces(CharSequence, int, int)</code></a>, |
| <a href="#trimWhitespaces(java.lang.CharSequence)"><code>trimWhitespaces(CharSequence)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="skipTrailingWhitespaces(java.lang.CharSequence,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>skipTrailingWhitespaces</h4> |
| <pre class="methodSignature">public static int skipTrailingWhitespaces​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| int toIndex)</pre> |
| <div class="block">Returns the index <em>after</em> the last non-white character in the given range. |
| If the given range contains only space characters, then this method returns the index of the |
| first character in the given range, which is always equals or lower than <code>fromIndex</code>. |
| |
| <p>Special cases:</p> |
| <ul> |
| <li>If <code>fromIndex</code> is lower than <code>toIndex</code>, |
| then this method unconditionally returns <code>toIndex</code>.</li> |
| <li>If the given range contains only space characters and the character at <code>fromIndex</code> |
| is the low surrogate of a valid supplementary code point, then this method returns |
| <code>fromIndex-1</code>, which is the index of the code point.</li> |
| <li>If <code>fromIndex</code> is negative or <code>toIndex</code> is greater than the text length, |
| then the behavior of this method is undefined.</li> |
| </ul> |
| |
| Space characters are identified by the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isWhitespace(int)" title="class or interface in java.lang" class="externalLink"><code>Character.isWhitespace(int)</code></a> method.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the string in which to perform the search (can not be null).</dd> |
| <dd><code>fromIndex</code> - the index from which to start the search (can not be negative).</dd> |
| <dd><code>toIndex</code> - the index after the last character where to perform the search.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the index within the text of the last occurrence of a non-space character, starting |
| at the specified index, or a value equals or lower than <code>fromIndex</code> if none.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if the <code>text</code> argument is null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#skipLeadingWhitespaces(java.lang.CharSequence,int,int)"><code>skipLeadingWhitespaces(CharSequence, int, int)</code></a>, |
| <a href="#trimWhitespaces(java.lang.CharSequence)"><code>trimWhitespaces(CharSequence)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="split(java.lang.CharSequence,char)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>split</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a>[] split​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| char separator)</pre> |
| <div class="block">Splits a text around the given character. The array returned by this method contains all |
| subsequences of the given text that is terminated by the given character or is terminated |
| by the end of the text. The subsequences in the array are in the order in which they occur |
| in the given text. If the character is not found in the input, then the resulting array has |
| just one element, which is the whole given text. |
| |
| <p>This method is similar to the standard <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#split(java.lang.String)" title="class or interface in java.lang" class="externalLink"><code>String.split(String)</code></a> method except for the |
| following:</p> |
| |
| <ul> |
| <li>It accepts generic character sequences.</li> |
| <li>It accepts <code>null</code> argument, in which case an empty array is returned.</li> |
| <li>The separator is a simple character instead than a regular expression.</li> |
| <li>If the <code>separator</code> argument is <code>'\n'</code> or <code>'\r'</code>, then this method |
| splits around any of <code>"\r"</code>, <code>"\n"</code> or <code>"\r\n"</code> characters sequences. |
| <li>The leading and trailing spaces of each subsequences are trimmed.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the text to split, or <code>null</code>.</dd> |
| <dd><code>separator</code> - the delimiting character (typically the coma).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the array of subsequences computed by splitting the given text around the given |
| character, or an empty array if <code>toSplit</code> was null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#split(java.lang.String)" title="class or interface in java.lang" class="externalLink"><code>String.split(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="splitOnEOL(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>splitOnEOL</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a>[] splitOnEOL​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</pre> |
| <div class="block">Splits a text around the <cite>End Of Line</cite> (EOL) characters. |
| EOL characters can be any of <code>"\r"</code>, <code>"\n"</code> or <code>"\r\n"</code> sequences. |
| Each element in the returned array will be a single line. If the given text is already |
| a single line, then this method returns a singleton containing only the given text. |
| |
| <p>Notes:</p> |
| <ul> |
| <li>At the difference of <code><a href="#split(java.lang.CharSequence,char)">split</a>(toSplit, '\n’)</code>, |
| this method does not remove whitespaces.</li> |
| <li>This method does not check for Unicode |
| <a href="Characters.html#LINE_SEPARATOR">line separator</a> and |
| <a href="Characters.html#PARAGRAPH_SEPARATOR">paragraph separator</a>.</li> |
| </ul> |
| |
| <div class="note"><b>Performance note:</b> |
| Prior JDK8 this method was usually cheap because all string instances created by |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#substring(int,int)" title="class or interface in java.lang" class="externalLink"><code>String.substring(int,int)</code></a> shared the same <code>char[]</code> internal array. |
| However since JDK8, the new <code>String</code> implementation copies the data in new arrays. |
| Consequently it is better to use index rather than this method for splitting large <code>String</code>s. |
| However this method still useful for other <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>CharSequence</code></a> implementations providing an efficient |
| <code>subSequence(int,int)</code> method.</div></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the multi-line text from which to get the individual lines, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the lines in the text, or an empty array if the given text was null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#indexOfLineStart(java.lang.CharSequence,int,int)"><code>indexOfLineStart(CharSequence, int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parseDoubles(java.lang.CharSequence,char)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseDoubles</h4> |
| <pre class="methodSignature">public static double[] parseDoubles​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></pre> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#parseDouble(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>double</code>. |
| Empty sub-sequences are parsed as <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#NaN" title="class or interface in java.lang" class="externalLink"><code>Double.NaN</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - the text containing the values to parse, or <code>null</code>.</dd> |
| <dd><code>separator</code> - the delimiting character (typically the coma).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the array of numbers parsed from the given text, |
| or an empty array if <code>values</code> was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if at least one number can not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parseFloats(java.lang.CharSequence,char)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseFloats</h4> |
| <pre class="methodSignature">public static float[] parseFloats​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></pre> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html?is-external=true#parseFloat(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>float</code>. |
| Empty sub-sequences are parsed as <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html?is-external=true#NaN" title="class or interface in java.lang" class="externalLink"><code>Float.NaN</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - the text containing the values to parse, or <code>null</code>.</dd> |
| <dd><code>separator</code> - the delimiting character (typically the coma).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the array of numbers parsed from the given text, |
| or an empty array if <code>values</code> was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if at least one number can not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parseLongs(java.lang.CharSequence,char,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseLongs</h4> |
| <pre class="methodSignature">public static long[] parseLongs​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></pre> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true#parseLong(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>long</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - the text containing the values to parse, or <code>null</code>.</dd> |
| <dd><code>separator</code> - the delimiting character (typically the coma).</dd> |
| <dd><code>radix</code> - the radix to be used for parsing. This is usually 10.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the array of numbers parsed from the given text, |
| or an empty array if <code>values</code> was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if at least one number can not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parseInts(java.lang.CharSequence,char,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseInts</h4> |
| <pre class="methodSignature">public static int[] parseInts​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></pre> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true#parseInt(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as an <code>int</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - the text containing the values to parse, or <code>null</code>.</dd> |
| <dd><code>separator</code> - the delimiting character (typically the coma).</dd> |
| <dd><code>radix</code> - the radix to be used for parsing. This is usually 10.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the array of numbers parsed from the given text, |
| or an empty array if <code>values</code> was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if at least one number can not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parseShorts(java.lang.CharSequence,char,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseShorts</h4> |
| <pre class="methodSignature">public static short[] parseShorts​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></pre> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Short.html?is-external=true#parseShort(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>short</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - the text containing the values to parse, or <code>null</code>.</dd> |
| <dd><code>separator</code> - the delimiting character (typically the coma).</dd> |
| <dd><code>radix</code> - the radix to be used for parsing. This is usually 10.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the array of numbers parsed from the given text, |
| or an empty array if <code>values</code> was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if at least one number can not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="parseBytes(java.lang.CharSequence,char,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parseBytes</h4> |
| <pre class="methodSignature">public static byte[] parseBytes​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> values, |
| char separator, |
| int radix) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></pre> |
| <div class="block"><a href="#split(java.lang.CharSequence,char)">Splits</a> the given text around the given character, |
| then <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Byte.html?is-external=true#parseByte(java.lang.String)" title="class or interface in java.lang" class="externalLink">parses</a> each item as a <code>byte</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - the text containing the values to parse, or <code>null</code>.</dd> |
| <dd><code>separator</code> - the delimiting character (typically the coma).</dd> |
| <dd><code>radix</code> - the radix to be used for parsing. This is usually 10.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the array of numbers parsed from the given text, |
| or an empty array if <code>values</code> was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NumberFormatException</a></code> - if at least one number can not be parsed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toASCII(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toASCII</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> toASCII​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</pre> |
| <div class="block">Replaces some Unicode characters by ASCII characters on a "best effort basis". |
| For example the “ é ” character is replaced by “ e ” (without accent), |
| the “ ″ ” symbol for minutes of angle is replaced by straight double quotes “ " ”, |
| and combined characters like ㎏, ㎎, ㎝, ㎞, ㎢, ㎦, ㎖, ㎧, ㎩, ㎐, <i>etc.</i> are replaced |
| by the corresponding sequences of characters. |
| |
| <div class="note"><b>Note:</b> |
| the replacement of Greek letters is a more complex task than what this method can do, |
| since it depends on the context. For example if the Greek letters are abbreviations |
| for coordinate system axes like φ and λ, then the replacements depend on the enclosing |
| coordinate system. See <a href="../io/wkt/Transliterator.html" title="class in org.apache.sis.io.wkt"><code>Transliterator</code></a> for more information.</div></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the text to scan for Unicode characters to replace by ASCII characters, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the given text with substitutions applied, or <code>text</code> if no replacement |
| has been applied, or <code>null</code> if the given text was null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="StringBuilders.html#toASCII(java.lang.StringBuilder)"><code>StringBuilders.toASCII(StringBuilder)</code></a>, |
| <a href="../io/wkt/Transliterator.html#filter(java.lang.String)"><code>Transliterator.filter(String)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/text/Normalizer.html?is-external=true" title="class or interface in java.text" class="externalLink"><code>Normalizer</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="trimWhitespaces(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>trimWhitespaces</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> trimWhitespaces​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> text)</pre> |
| <div class="block">Returns a string with leading and trailing whitespace characters omitted. |
| This method is similar in purpose to <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#trim()" title="class or interface in java.lang" class="externalLink"><code>String.trim()</code></a>, except that the later considers |
| every <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isISOControl(int)" title="class or interface in java.lang" class="externalLink">ISO control codes</a> below 32 to be a whitespace. |
| That <code>String.trim()</code> behavior has the side effect of removing the heading of ANSI escape |
| sequences (a.k.a. X3.64), and to ignore Unicode spaces. This <code>trimWhitespaces(…)</code> method |
| is built on the more accurate <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isWhitespace(int)" title="class or interface in java.lang" class="externalLink"><code>Character.isWhitespace(int)</code></a> method instead. |
| |
| <p>This method performs the same work than <a href="#trimWhitespaces(java.lang.CharSequence)"><code>trimWhitespaces(CharSequence)</code></a>, |
| but is overloaded for the <code>String</code> type because of its frequent use.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the text from which to remove leading and trailing whitespaces, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a string with leading and trailing whitespaces removed, or <code>null</code> is the given |
| text was null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="trimWhitespaces(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>trimWhitespaces</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> trimWhitespaces​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</pre> |
| <div class="block">Returns a text with leading and trailing whitespace characters omitted. |
| Space characters are identified by the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isWhitespace(int)" title="class or interface in java.lang" class="externalLink"><code>Character.isWhitespace(int)</code></a> method. |
| |
| <p>This method is the generic version of <a href="#trimWhitespaces(java.lang.String)"><code>trimWhitespaces(String)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the text from which to remove leading and trailing whitespaces, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a characters sequence with leading and trailing whitespaces removed, |
| or <code>null</code> is the given text was null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#skipLeadingWhitespaces(java.lang.CharSequence,int,int)"><code>skipLeadingWhitespaces(CharSequence, int, int)</code></a>, |
| <a href="#skipTrailingWhitespaces(java.lang.CharSequence,int,int)"><code>skipTrailingWhitespaces(CharSequence, int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="trimWhitespaces(java.lang.CharSequence,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>trimWhitespaces</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> trimWhitespaces​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int lower, |
| int upper)</pre> |
| <div class="block">Returns a sub-sequence with leading and trailing whitespace characters omitted. |
| Space characters are identified by the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isWhitespace(int)" title="class or interface in java.lang" class="externalLink"><code>Character.isWhitespace(int)</code></a> method. |
| |
| <p>Invoking this method is functionally equivalent to the following code snippet, |
| except that the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true#subSequence(int,int)" title="class or interface in java.lang" class="externalLink"><code>subSequence</code></a> method is |
| invoked only once instead of two times:</p> |
| |
| <blockquote><pre>text = <b>trimWhitespaces</b>(text.<b>subSequence</b>(lower, upper));</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the text from which to remove leading and trailing white spaces.</dd> |
| <dd><code>lower</code> - index of the first character to consider for inclusion in the sub-sequence.</dd> |
| <dd><code>upper</code> - index after the last character to consider for inclusion in the sub-sequence.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a characters sequence with leading and trailing white spaces removed, or <code>null</code> |
| if the <code>text</code> argument is null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if <code>lower</code> or <code>upper</code> is out of bounds.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="trimFractionalPart(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>trimFractionalPart</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> trimFractionalPart​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> value)</pre> |
| <div class="block">Trims the fractional part of the given formatted number, provided that it doesn't change |
| the value. This method assumes that the number is formatted in the US locale, typically |
| by the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#toString(double)" title="class or interface in java.lang" class="externalLink"><code>Double.toString(double)</code></a> method. |
| |
| <p>More specifically if the given value ends with a <code>'.'</code> character followed by a |
| sequence of <code>'0'</code> characters, then those characters are omitted. Otherwise this |
| method returns the text unchanged. This is a <cite>"all or nothing"</cite> method: |
| either the fractional part is completely removed, or either it is left unchanged.</p> |
| |
| <div class="section">Examples</div> |
| This method returns <code>"4"</code> if the given value is <code>"4."</code>, <code>"4.0"</code> or |
| <code>"4.00"</code>, but returns <code>"4.10"</code> unchanged (including the trailing <code>'0'</code> |
| character) if the input is <code>"4.10"</code>. |
| |
| <div class="section">Use case</div> |
| This method is useful before to <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true#parseInt(java.lang.String)" title="class or interface in java.lang" class="externalLink">parse a number</a> |
| if that number should preferably be parsed as an integer before attempting to parse |
| it as a floating point number.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - the value to trim if possible, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value without the trailing <code>".0"</code> part (if any), |
| or <code>null</code> if the given text was null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="StringBuilders.html#trimFractionalPart(java.lang.StringBuilder)"><code>StringBuilders.trimFractionalPart(StringBuilder)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="shortSentence(java.lang.CharSequence,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>shortSentence</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> shortSentence​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int maxLength)</pre> |
| <div class="block">Makes sure that the <code>text</code> string is not longer than <code>maxLength</code> characters. |
| If <code>text</code> is not longer, then it is returned unchanged. Otherwise this method returns |
| a copy of <code>text</code> with some characters substituted by the <code>"(…)"</code> string. |
| |
| <p>If the text needs to be shortened, then this method tries to apply the above-cited |
| substitution between two words. For example, the following text:</p> |
| |
| <blockquote> |
| "This sentence given as an example is way too long to be included in a short name." |
| </blockquote> |
| |
| May be shortened to something like this: |
| |
| <blockquote> |
| "This sentence given (…) in a short name." |
| </blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the sentence to reduce if it is too long, or <code>null</code>.</dd> |
| <dd><code>maxLength</code> - the maximum length allowed for <code>text</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a sentence not longer than <code>maxLength</code>, or <code>null</code> if the given text was null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="upperCaseToSentence(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>upperCaseToSentence</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> upperCaseToSentence​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier)</pre> |
| <div class="block">Given a string in upper cases (typically a Java constant), returns a string formatted |
| like an English sentence. This heuristic method performs the following steps: |
| |
| <ol> |
| <li>Replace all occurrences of <code>'_'</code> by spaces.</li> |
| <li>Converts all letters except the first one to lower case letters using |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#toLowerCase(int)" title="class or interface in java.lang" class="externalLink"><code>Character.toLowerCase(int)</code></a>. Note that this method does not use |
| the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#toLowerCase()" title="class or interface in java.lang" class="externalLink"><code>String.toLowerCase()</code></a> method. Consequently the system locale |
| is ignored. This method behaves as if the conversion were done in the |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#ROOT" title="class or interface in java.util" class="externalLink">root</a> locale.</li> |
| </ol> |
| |
| <p>Note that those heuristic rules may be modified in future SIS versions, |
| depending on the practical experience gained.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>identifier</code> - the name of a Java constant, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the identifier like an English sentence, or <code>null</code> |
| if the given <code>identifier</code> argument was null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="camelCaseToSentence(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>camelCaseToSentence</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> camelCaseToSentence​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier)</pre> |
| <div class="block">Given a string in camel cases (typically an identifier), returns a string formatted |
| like an English sentence. This heuristic method performs the following steps: |
| |
| <ol> |
| <li>Invoke <a href="#camelCaseToWords(java.lang.CharSequence,boolean)"><code>camelCaseToWords(CharSequence, boolean)</code></a>, which separate the words |
| on the basis of character case. For example <code>"transferFunctionType"</code> become |
| <cite>"transfer function type"</cite>. This works fine for ISO 19115 identifiers.</li> |
| |
| <li>Next replace all occurrence of <code>'_'</code> by spaces in order to take in account |
| an other common naming convention, which uses <code>'_'</code> as a word separator. This |
| convention is used by netCDF attributes like <code>"project_name"</code>.</li> |
| |
| <li>Finally ensure that the first character is upper-case.</li> |
| </ol> |
| |
| <div class="section">Exception to the above rules</div> |
| If the given identifier contains only upper-case letters, digits and the <code>'_'</code> character, |
| then the identifier is returned "as is" except for the <code>'_'</code> characters which are replaced by <code>'-'</code>. |
| This work well for identifiers like <code>"UTF-8"</code> or <code>"ISO-LATIN-1"</code> for instance. |
| |
| <p>Note that those heuristic rules may be modified in future SIS versions, |
| depending on the practical experience gained.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>identifier</code> - an identifier with no space, words begin with an upper-case character, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the identifier with spaces inserted after what looks like words, or <code>null</code> |
| if the given <code>identifier</code> argument was null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="camelCaseToWords(java.lang.CharSequence,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>camelCaseToWords</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> camelCaseToWords​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier, |
| boolean toLowerCase)</pre> |
| <div class="block">Given a string in camel cases, returns a string with the same words separated by spaces. |
| A word begins with a upper-case character following a lower-case character. For example |
| if the given string is <code>"PixelInterleavedSampleModel"</code>, then this method returns |
| <cite>"Pixel Interleaved Sample Model"</cite> or <cite>"Pixel interleaved sample model"</cite> |
| depending on the value of the <code>toLowerCase</code> argument. |
| |
| <p>If <code>toLowerCase</code> is <code>false</code>, then this method inserts spaces but does not change |
| the case of characters. If <code>toLowerCase</code> is <code>true</code>, then this method changes |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#toLowerCase(int)" title="class or interface in java.lang" class="externalLink">to lower case</a> the first character after each spaces |
| inserted by this method (note that this intentionally exclude the very first character in |
| the given string), except if the second character <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isUpperCase(int)" title="class or interface in java.lang" class="externalLink">is upper case</a>, in which case the word is assumed an acronym.</p> |
| |
| <p>The given string is usually a programmatic identifier like a class name or a method name.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>identifier</code> - an identifier with no space, words begin with an upper-case character.</dd> |
| <dd><code>toLowerCase</code> - <code>true</code> for changing the first character of words to lower case, |
| except for the first word and acronyms.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the identifier with spaces inserted after what looks like words, or <code>null</code> |
| if the given <code>identifier</code> argument was null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="camelCaseToAcronym(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>camelCaseToAcronym</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> camelCaseToAcronym​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</pre> |
| <div class="block">Creates an acronym from the given text. This method returns a string containing the first character of each word, |
| where the words are separated by the camel case convention, the <code>'_'</code> character, or any character which is |
| not a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isUnicodeIdentifierPart(int)" title="class or interface in java.lang" class="externalLink">Unicode identifier part</a> (including spaces). |
| |
| <p>An exception to the above rule happens if the given text is a Unicode identifier without the <code>'_'</code> |
| character, and every characters are upper case. In such case the text is returned unchanged on the assumption |
| that it is already an acronym.</p> |
| |
| <p><b>Examples:</b> given <code>"northEast"</code>, this method returns <code>"NE"</code>. |
| Given <code>"Open Geospatial Consortium"</code>, this method returns <code>"OGC"</code>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the text for which to create an acronym, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the acronym, or <code>null</code> if the given text was null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isAcronymForWords(java.lang.CharSequence,java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAcronymForWords</h4> |
| <pre class="methodSignature">public static boolean isAcronymForWords​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> acronym, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> words)</pre> |
| <div class="block">Returns <code>true</code> if the first string is likely to be an acronym of the second string. |
| An acronym is a sequence of <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isLetterOrDigit(int)" title="class or interface in java.lang" class="externalLink">letters or digits</a> |
| built from at least one character of each word in the <code>words</code> string. More than |
| one character from the same word may appear in the acronym, but they must always |
| be the first consecutive characters. The comparison is case-insensitive. |
| |
| <div class="note"><b>Example:</b> |
| Given the <code>"Open Geospatial Consortium"</code> words, the following strings are recognized as acronyms: |
| <code>"OGC"</code>, <code>"ogc"</code>, <code>"O.G.C."</code>, <code>"OpGeoCon"</code>.</div> |
| |
| If any of the given arguments is <code>null</code>, this method returns <code>false</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>acronym</code> - a possible acronym of the sequence of words, or <code>null</code>.</dd> |
| <dd><code>words</code> - the sequence of words, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the first string is an acronym of the second one.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isUnicodeIdentifier(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isUnicodeIdentifier</h4> |
| <pre class="methodSignature">public static boolean isUnicodeIdentifier​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> identifier)</pre> |
| <div class="block">Returns <code>true</code> if the given identifier is a legal Unicode identifier. |
| This method returns <code>true</code> if the identifier length is greater than zero, |
| the first character is a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isUnicodeIdentifierStart(int)" title="class or interface in java.lang" class="externalLink">Unicode identifier start</a> and all remaining characters (if any) are |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isUnicodeIdentifierPart(int)" title="class or interface in java.lang" class="externalLink">Unicode identifier parts</a>. |
| |
| <div class="section">Relationship with legal XML identifiers</div> |
| Most legal Unicode identifiers are also legal XML identifiers, but the converse is not true. |
| The most noticeable differences are the ‘<code>:</code>’, ‘<code>-</code>’ and ‘<code>.</code>’ characters, |
| which are legal in XML identifiers but not in Unicode. |
| |
| <table class="sis"> |
| <caption>Characters legal in one set but not in the other</caption> |
| <tr><th colspan="2">Not legal in Unicode</th> <th class="sep" colspan="2">Not legal in XML</th></tr> |
| <tr><td><code>:</code></td><td>(colon)</td> <td class="sep"><code>µ</code></td><td>(micro sign)</td></tr> |
| <tr><td><code>-</code></td><td>(hyphen or minus)</td> <td class="sep"><code>ª</code></td><td>(feminine ordinal indicator)</td></tr> |
| <tr><td><code>.</code></td><td>(dot)</td> <td class="sep"><code>º</code></td><td>(masculine ordinal indicator)</td></tr> |
| <tr><td><code>·</code></td><td>(middle dot)</td> <td class="sep"><code>⁔</code></td><td>(inverted undertie)</td></tr> |
| <tr> |
| <td colspan="2">Many punctuation, symbols, <i>etc</i>.</td> |
| <td colspan="2" class="sep"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isIdentifierIgnorable(int)" title="class or interface in java.lang" class="externalLink">Identifier ignorable</a> characters.</td> |
| </tr> |
| </table> |
| |
| Note that the ‘<code>_</code>’ (underscore) character is legal according both Unicode and XML, while spaces, |
| ‘<code>!</code>’, ‘<code>#</code>’, ‘<code>*</code>’, ‘<code>/</code>’, ‘<code>?</code>’ and most other punctuation characters are not. |
| |
| <div class="section">Usage in Apache SIS</div> |
| In its handling of <a href="../referencing/ImmutableIdentifier.html" title="class in org.apache.sis.referencing">identifiers</a>, Apache SIS favors |
| Unicode identifiers without <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isIdentifierIgnorable(int)" title="class or interface in java.lang" class="externalLink">ignorable</a> characters since those |
| identifiers are legal XML identifiers except for the above-cited rarely used characters. As a side effect, |
| this policy excludes ‘<code>:</code>’, ‘<code>-</code>’ and ‘<code>.</code>’ which would normally be legal XML identifiers. |
| But since those characters could easily be confused with |
| <a href="iso/DefaultNameSpace.html#DEFAULT_SEPARATOR">namespace separators</a>, |
| this exclusion is considered desirable.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>identifier</code> - the character sequence to test, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the given character sequence is a legal Unicode identifier.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../referencing/ImmutableIdentifier.html" title="class in org.apache.sis.referencing"><code>ImmutableIdentifier</code></a>, |
| <a href="../metadata/iso/citation/Citations.html#toCodeSpace(org.opengis.metadata.citation.Citation)"><code>Citations.toCodeSpace(Citation)</code></a>, |
| <a href="../referencing/IdentifiedObjects.html#getSimpleNameOrIdentifier(org.opengis.referencing.IdentifiedObject)"><code>IdentifiedObjects.getSimpleNameOrIdentifier(IdentifiedObject)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isUpperCase(java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isUpperCase</h4> |
| <pre class="methodSignature">public static boolean isUpperCase​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text)</pre> |
| <div class="block">Returns <code>true</code> if the given text is non-null, contains at least one upper-case character and |
| no lower-case character. Space and punctuation are ignored.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence to test (may be <code>null</code>).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if non-null, contains at least one upper-case character and no lower-case character.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.7</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#toUpperCase()" title="class or interface in java.lang" class="externalLink"><code>String.toUpperCase()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="equalsFiltered(java.lang.CharSequence,java.lang.CharSequence,org.apache.sis.util.Characters.Filter,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equalsFiltered</h4> |
| <pre class="methodSignature">public static boolean equalsFiltered​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2, |
| <a href="Characters.Filter.html" title="class in org.apache.sis.util">Characters.Filter</a> filter, |
| boolean ignoreCase)</pre> |
| <div class="block">Returns <code>true</code> if the given texts are equal, optionally ignoring case and filtered-out characters. |
| This method is sometime used for comparing identifiers in a lenient way. |
| |
| <p><b>Example:</b> the following call compares the two strings ignoring case and any |
| characters which are not <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isLetterOrDigit(int)" title="class or interface in java.lang" class="externalLink">letter or digit</a>. |
| In particular, spaces and punctuation characters like <code>'_'</code> and <code>'-'</code> are |
| ignored:</p> |
| |
| <blockquote><pre><font color="green">assert</font> <b>equalsFiltered</b>(<font color="orangered">"WGS84"</font>, <font color="orangered">"WGS_84"</font>, Characters.Filter.LETTERS_AND_DIGITS, <font color="green">true</font>) == <font color="green">true</font>;</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s1</code> - the first characters sequence to compare, or <code>null</code>.</dd> |
| <dd><code>s2</code> - the second characters sequence to compare, or <code>null</code>.</dd> |
| <dd><code>filter</code> - the subset of characters to compare, or <code>null</code> for comparing all characters.</dd> |
| <dd><code>ignoreCase</code> - <code>true</code> for ignoring cases, or <code>false</code> for requiring exact match.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if both arguments are <code>null</code> or if the two given texts are equal, |
| optionally ignoring case and filtered-out characters.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="equalsIgnoreCase(java.lang.CharSequence,java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equalsIgnoreCase</h4> |
| <pre class="methodSignature">public static boolean equalsIgnoreCase​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</pre> |
| <div class="block">Returns <code>true</code> if the two given texts are equal, ignoring case. |
| This method is similar to <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#equalsIgnoreCase(java.lang.String)" title="class or interface in java.lang" class="externalLink"><code>String.equalsIgnoreCase(String)</code></a>, except |
| it works on arbitrary character sequences and compares <cite>code points</cite> |
| instead than characters.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s1</code> - the first string to compare, or <code>null</code>.</dd> |
| <dd><code>s2</code> - the second string to compare, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the two given texts are equal, ignoring case, |
| or if both arguments are <code>null</code>.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#equalsIgnoreCase(java.lang.String)" title="class or interface in java.lang" class="externalLink"><code>String.equalsIgnoreCase(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="equals(java.lang.CharSequence,java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equals</h4> |
| <pre class="methodSignature">public static boolean equals​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</pre> |
| <div class="block">Returns <code>true</code> if the two given texts are equal. This method delegates to |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#contentEquals(java.lang.CharSequence)" title="class or interface in java.lang" class="externalLink"><code>String.contentEquals(CharSequence)</code></a> if possible. This method never invoke |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink"><code>CharSequence.toString()</code></a> in order to avoid a potentially large copy of data.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s1</code> - the first string to compare, or <code>null</code>.</dd> |
| <dd><code>s2</code> - the second string to compare, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the two given texts are equal, or if both arguments are <code>null</code>.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#contentEquals(java.lang.CharSequence)" title="class or interface in java.lang" class="externalLink"><code>String.contentEquals(CharSequence)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="regionMatches(java.lang.CharSequence,int,java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>regionMatches</h4> |
| <pre class="methodSignature">public static boolean regionMatches​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> part)</pre> |
| <div class="block">Returns <code>true</code> if the given text at the given offset contains the given part, |
| in a case-sensitive comparison. This method is equivalent to the following code, |
| except that this method works on arbitrary <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>CharSequence</code></a> objects instead than |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>String</code></a>s only: |
| |
| <blockquote><pre><font color="green">return</font> text.<b>regionMatches</b>(offset, part, 0, part.<b>length</b>());</pre></blockquote> |
| |
| This method does not thrown <code>IndexOutOfBoundsException</code>. Instead if |
| <code>fromIndex < 0</code> or <code>fromIndex + part.length() > text.length()</code>, |
| then this method returns <code>false</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence for which to tests for the presence of <code>part</code>.</dd> |
| <dd><code>fromIndex</code> - the offset in <code>text</code> where to test for the presence of <code>part</code>.</dd> |
| <dd><code>part</code> - the part which may be present in <code>text</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if <code>text</code> contains <code>part</code> at the given <code>offset</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if any of the arguments is null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#regionMatches(int,java.lang.String,int,int)" title="class or interface in java.lang" class="externalLink"><code>String.regionMatches(int, String, int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="regionMatches(java.lang.CharSequence,int,java.lang.CharSequence,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>regionMatches</h4> |
| <pre class="methodSignature">public static boolean regionMatches​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> part, |
| boolean ignoreCase)</pre> |
| <div class="block">Returns <code>true</code> if the given text at the given offset contains the given part, |
| optionally in a case-insensitive way. This method is equivalent to the following code, |
| except that this method works on arbitrary <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>CharSequence</code></a> objects instead than |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>String</code></a>s only: |
| |
| <blockquote><pre><font color="green">return</font> text.<b>regionMatches</b>(ignoreCase, offset, part, 0, part.<b>length</b>());</pre></blockquote> |
| |
| This method does not thrown <code>IndexOutOfBoundsException</code>. Instead if |
| <code>fromIndex < 0</code> or <code>fromIndex + part.length() > text.length()</code>, |
| then this method returns <code>false</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence for which to tests for the presence of <code>part</code>.</dd> |
| <dd><code>fromIndex</code> - the offset in <code>text</code> where to test for the presence of <code>part</code>.</dd> |
| <dd><code>part</code> - the part which may be present in <code>text</code>.</dd> |
| <dd><code>ignoreCase</code> - <code>true</code> if the case should be ignored.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if <code>text</code> contains <code>part</code> at the given <code>offset</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if any of the arguments is null.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.4</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#regionMatches(boolean,int,java.lang.String,int,int)" title="class or interface in java.lang" class="externalLink"><code>String.regionMatches(boolean, int, String, int, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="startsWith(java.lang.CharSequence,java.lang.CharSequence,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>startsWith</h4> |
| <pre class="methodSignature">public static boolean startsWith​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> prefix, |
| boolean ignoreCase)</pre> |
| <div class="block">Returns <code>true</code> if the given character sequence starts with the given prefix.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the characters sequence to test.</dd> |
| <dd><code>prefix</code> - the expected prefix.</dd> |
| <dd><code>ignoreCase</code> - <code>true</code> if the case should be ignored.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the given sequence starts with the given prefix.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if any of the arguments is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="endsWith(java.lang.CharSequence,java.lang.CharSequence,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>endsWith</h4> |
| <pre class="methodSignature">public static boolean endsWith​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> suffix, |
| boolean ignoreCase)</pre> |
| <div class="block">Returns <code>true</code> if the given character sequence ends with the given suffix.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the characters sequence to test.</dd> |
| <dd><code>suffix</code> - the expected suffix.</dd> |
| <dd><code>ignoreCase</code> - <code>true</code> if the case should be ignored.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the given sequence ends with the given suffix.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if any of the arguments is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="commonPrefix(java.lang.CharSequence,java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>commonPrefix</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> commonPrefix​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</pre> |
| <div class="block">Returns the longest sequence of characters which is found at the beginning of the two |
| given texts. If one of those texts is <code>null</code>, then the other text is returned.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s1</code> - the first text, or <code>null</code>.</dd> |
| <dd><code>s2</code> - the second text, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the common prefix of both texts, or <code>null</code> if both texts are null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="commonSuffix(java.lang.CharSequence,java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>commonSuffix</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> commonSuffix​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> s2)</pre> |
| <div class="block">Returns the longest sequence of characters which is found at the end of the two given texts. |
| If one of those texts is <code>null</code>, then the other text is returned.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s1</code> - the first text, or <code>null</code>.</dd> |
| <dd><code>s2</code> - the second text, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the common suffix of both texts, or <code>null</code> if both texts are null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="token(java.lang.CharSequence,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>token</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> token​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| int fromIndex)</pre> |
| <div class="block">Returns the token starting at the given offset in the given text. For the purpose of this |
| method, a "token" is any sequence of consecutive characters of the same type, as defined |
| below. |
| |
| <p>Let define <var>c</var> as the first non-blank character located at an index equals or |
| greater than the given offset. Then the characters that are considered of the same type |
| are:</p> |
| |
| <ul> |
| <li>If <var>c</var> is a |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isUnicodeIdentifierStart(int)" title="class or interface in java.lang" class="externalLink">Unicode identifier start</a>, |
| then any following characters that are |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#isUnicodeIdentifierPart(int)" title="class or interface in java.lang" class="externalLink">Unicode identifier part</a>.</li> |
| <li>Otherwise any character for which <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html?is-external=true#getType(int)" title="class or interface in java.lang" class="externalLink"><code>Character.getType(int)</code></a> returns |
| the same value than for <var>c</var>.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the text for which to get the token.</dd> |
| <dd><code>fromIndex</code> - index of the fist character to consider in the given text.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a sub-sequence of <code>text</code> starting at the given offset, or an empty string |
| if there is no non-blank character at or after the given offset.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if the <code>text</code> argument is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="replace(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>replace</h4> |
| <pre class="methodSignature">public static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> replace​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> text, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> toSearch, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> replaceBy)</pre> |
| <div class="block">Replaces all occurrences of a given string in the given character sequence. If no occurrence of |
| <code>toSearch</code> is found in the given text or if <code>toSearch</code> is equal to <code>replaceBy</code>, |
| then this method returns the <code>text</code> unchanged. |
| Otherwise this method returns a new character sequence with all occurrences replaced by <code>replaceBy</code>. |
| |
| <p>This method is similar to <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#replace(java.lang.CharSequence,java.lang.CharSequence)" title="class or interface in java.lang" class="externalLink"><code>String.replace(CharSequence, CharSequence)</code></a> except that is accepts |
| arbitrary <code>CharSequence</code> objects. As of Java 10, another difference is that this method does not |
| create a new <code>String</code> if <code>toSearch</code> is equals to <code>replaceBy</code>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>text</code> - the character sequence in which to perform the replacements, or <code>null</code>.</dd> |
| <dd><code>toSearch</code> - the string to replace.</dd> |
| <dd><code>replaceBy</code> - the replacement for the searched string.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the given text with replacements applied, or <code>text</code> if no replacement has been applied, |
| or <code>null</code> if the given text was null</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.4</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#replace(char,char)" title="class or interface in java.lang" class="externalLink"><code>String.replace(char, char)</code></a>, |
| <a href="StringBuilders.html#replace(java.lang.StringBuilder,java.lang.String,java.lang.String)"><code>StringBuilders.replace(StringBuilder, String, String)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#replace(java.lang.CharSequence,java.lang.CharSequence)" title="class or interface in java.lang" class="externalLink"><code>String.replace(CharSequence, CharSequence)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="copyChars(java.lang.CharSequence,int,char[],int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>copyChars</h4> |
| <pre class="methodSignature">public static void copyChars​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang" class="externalLink">CharSequence</a> src, |
| int srcOffset, |
| char[] dst, |
| int dstOffset, |
| int length)</pre> |
| <div class="block">Copies a sequence of characters in the given <code>char[]</code> array.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>src</code> - the characters sequence from which to copy characters.</dd> |
| <dd><code>srcOffset</code> - index of the first character from <code>src</code> to copy.</dd> |
| <dd><code>dst</code> - the array where to copy the characters.</dd> |
| <dd><code>dstOffset</code> - index where to write the first character in <code>dst</code>.</dd> |
| <dd><code>length</code> - number of characters to copy.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#getChars(int,int,char%5B%5D,int)" title="class or interface in java.lang" class="externalLink"><code>String.getChars(int, int, char[], int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html?is-external=true#getChars(int,int,char%5B%5D,int)" title="class or interface in java.lang" class="externalLink"><code>StringBuilder.getChars(int, int, char[], int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuffer.html?is-external=true#getChars(int,int,char%5B%5D,int)" title="class or interface in java.lang" class="externalLink"><code>StringBuffer.getChars(int, int, char[], int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/CharBuffer.html?is-external=true#get(char%5B%5D,int,int)" title="class or interface in java.nio" class="externalLink"><code>CharBuffer.get(char[], int, int)</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Segment.html?is-external=true#array" title="class or interface in javax.swing.text" class="externalLink"><code>Segment.array</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/CharSequences.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |