Javadoc; Move @since; Add documented constructor
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1077901 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4046e160ff
commit
ee17d69249
|
@ -17,32 +17,45 @@
|
||||||
package org.apache.commons.lang3;
|
package org.apache.commons.lang3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Null-safe CharSequence utility methods.
|
* <p>Operations on {@code CharSequence} that are
|
||||||
|
* <code>null</code> safe.</p>
|
||||||
*
|
*
|
||||||
|
* @author Apache Software Foundation
|
||||||
* @author Gary Gregory
|
* @author Gary Gregory
|
||||||
|
* @since 3.0
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class CharSequenceUtils {
|
public class CharSequenceUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new <code>CharSequence</code> that is a subsequence of this
|
* <p>{@code CharSequenceUtils} instances should NOT be constructed in
|
||||||
* sequence starting with the <code>char</code> value at the specified
|
* standard programming. Instead, the static methods on the class should
|
||||||
* index. The length (in <code>char</code>s) of the returned sequence is
|
* be used, such as {@code CharSequenceUtils.subSequence(cs, 4);}.</p>
|
||||||
* <code>length() - start</code>, so if <code>start == end</code> then an
|
|
||||||
* empty sequence is returned. </p>
|
|
||||||
*
|
*
|
||||||
* @param cs
|
* <p>This constructor is public to permit tools that require a JavaBean
|
||||||
* the specified subsequence, may be null
|
* instance to operate.</p>
|
||||||
* @param start
|
*/
|
||||||
* the start index, inclusive
|
public CharSequenceUtils() {
|
||||||
* @return a new subsequence or null
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>Returns a new {@code CharSequence} that is a subsequence of this
|
||||||
|
* sequence starting with the {@code char} value at the specified index.</p>
|
||||||
|
*
|
||||||
|
* <p>This provides the {@code CharSequence} equivalent to {@link String#substring(int)}.
|
||||||
|
* The length (in {@code char}) of the returned sequence is {@code length() - start},
|
||||||
|
* so if {@start == end} then an empty sequence is returned.</p>
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @param cs the specified subsequence, null returns null
|
||||||
* if <code>start</code> is negative or if <code>start</code> is
|
* @param start the start index, inclusive, valid
|
||||||
* greater than <code>length()</code>
|
* @return a new subsequence, may be null
|
||||||
* @since 3.0
|
* @throws IndexOutOfBoundsException if {@code start} is negative or if
|
||||||
|
* {@code start} is greater than {@code length()}
|
||||||
*/
|
*/
|
||||||
public static CharSequence subSequence(CharSequence cs, int start) {
|
public static CharSequence subSequence(CharSequence cs, int start) {
|
||||||
return cs == null ? null : cs.subSequence(start, cs.length());
|
return cs == null ? null : cs.subSequence(start, cs.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue