<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FFile_Input_Output%2FCharSequence</id>
		<title>Java/File Input Output/CharSequence - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FFile_Input_Output%2FCharSequence"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/File_Input_Output/CharSequence&amp;action=history"/>
		<updated>2026-04-21T20:09:24Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/File_Input_Output/CharSequence&amp;diff=6231&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/File_Input_Output/CharSequence&amp;diff=6231&amp;oldid=prev"/>
				<updated>2010-06-01T06:04:42Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:04, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/File_Input_Output/CharSequence&amp;diff=6230&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/File_Input_Output/CharSequence&amp;diff=6230&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== A contiguous range of characters, optionally negated. ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
/*&lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one or more&lt;br /&gt;
 * contributor license agreements.  See the NOTICE file distributed with&lt;br /&gt;
 * this work for additional information regarding copyright ownership.&lt;br /&gt;
 * The ASF licenses this file to You under the Apache License, Version 2.0&lt;br /&gt;
 * (the &amp;quot;License&amp;quot;); you may not use this file except in compliance with&lt;br /&gt;
 * the License.  You may obtain a copy of the License at&lt;br /&gt;
 * &lt;br /&gt;
 *      http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 * &lt;br /&gt;
 * Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 * distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
 * See the License for the specific language governing permissions and&lt;br /&gt;
 * limitations under the License.&lt;br /&gt;
 */&lt;br /&gt;
import java.io.Serializable;&lt;br /&gt;
/**&lt;br /&gt;
 * &amp;lt;p&amp;gt;A contiguous range of characters, optionally negated.&amp;lt;/p&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * &amp;lt;p&amp;gt;Instances are immutable.&amp;lt;/p&amp;gt;&lt;br /&gt;
 *&lt;br /&gt;
 * @author Stephen Colebourne&lt;br /&gt;
 * @author Chris Feldhacker&lt;br /&gt;
 * @author Gary Gregory&lt;br /&gt;
 * @since 1.0&lt;br /&gt;
 * @version $Id: CharRange.java 471626 2006-11-06 04:02:09Z bayard $&lt;br /&gt;
 */&lt;br /&gt;
public final class CharRange implements Serializable {&lt;br /&gt;
    /**&lt;br /&gt;
     * Required for serialization support. Lang version 2.0. &lt;br /&gt;
     * &lt;br /&gt;
     * @see java.io.Serializable&lt;br /&gt;
     */&lt;br /&gt;
    private static final long serialVersionUID = 8270183163158333422L;&lt;br /&gt;
    &lt;br /&gt;
    /** The first character, inclusive, in the range. */&lt;br /&gt;
    private final char start;&lt;br /&gt;
    /** The last character, inclusive, in the range. */&lt;br /&gt;
    private final char end;&lt;br /&gt;
    /** True if the range is everything except the characters specified. */&lt;br /&gt;
    private final boolean negated;&lt;br /&gt;
    &lt;br /&gt;
    /** Cached toString. */&lt;br /&gt;
    private transient String iToString;&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Constructs a &amp;lt;code&amp;gt;CharRange&amp;lt;/code&amp;gt; over a single character.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * @param ch  only character in this range&lt;br /&gt;
     */&lt;br /&gt;
    public CharRange(char ch) {&lt;br /&gt;
        this(ch, ch, false);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Constructs a &amp;lt;code&amp;gt;CharRange&amp;lt;/code&amp;gt; over a single character,&lt;br /&gt;
     * optionally negating the range.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * &amp;lt;p&amp;gt;A negated range includes everything except the specified char.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * @param ch  only character in this range&lt;br /&gt;
     * @param negated  true to express everything except the range&lt;br /&gt;
     */&lt;br /&gt;
    public CharRange(char ch, boolean negated) {&lt;br /&gt;
        this(ch, ch, negated);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Constructs a &amp;lt;code&amp;gt;CharRange&amp;lt;/code&amp;gt; over a set of characters.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * @param start  first character, inclusive, in this range&lt;br /&gt;
     * @param end  last character, inclusive, in this range&lt;br /&gt;
     */&lt;br /&gt;
    public CharRange(char start, char end) {&lt;br /&gt;
        this(start, end, false);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Constructs a &amp;lt;code&amp;gt;CharRange&amp;lt;/code&amp;gt; over a set of characters,&lt;br /&gt;
     * optionally negating the range.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * &amp;lt;p&amp;gt;A negated range includes everything except that defined by the&lt;br /&gt;
     * start and end characters.&amp;lt;/p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * &amp;lt;p&amp;gt;If start and end are in the wrong order, they are reversed.&lt;br /&gt;
     * Thus &amp;lt;code&amp;gt;a-e&amp;lt;/code&amp;gt; is the same as &amp;lt;code&amp;gt;e-a&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * @param start  first character, inclusive, in this range&lt;br /&gt;
     * @param end  last character, inclusive, in this range&lt;br /&gt;
     * @param negated  true to express everything except the range&lt;br /&gt;
     */&lt;br /&gt;
    public CharRange(char start, char end, boolean negated) {&lt;br /&gt;
        super();&lt;br /&gt;
        if (start &amp;gt; end) {&lt;br /&gt;
            char temp = start;&lt;br /&gt;
            start = end;&lt;br /&gt;
            end = temp;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        this.start = start;&lt;br /&gt;
        this.end = end;&lt;br /&gt;
        this.negated = negated;&lt;br /&gt;
    }&lt;br /&gt;
    // Accessors&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Gets the start character for this character range.&amp;lt;/p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * @return the start char (inclusive)&lt;br /&gt;
     */&lt;br /&gt;
    public char getStart() {&lt;br /&gt;
        return this.start;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Gets the end character for this character range.&amp;lt;/p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * @return the end char (inclusive)&lt;br /&gt;
     */&lt;br /&gt;
    public char getEnd() {&lt;br /&gt;
        return this.end;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Is this &amp;lt;code&amp;gt;CharRange&amp;lt;/code&amp;gt; negated.&amp;lt;/p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * &amp;lt;p&amp;gt;A negated range includes everything except that defined by the&lt;br /&gt;
     * start and end characters.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * @return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; is negated&lt;br /&gt;
     */&lt;br /&gt;
    public boolean isNegated() {&lt;br /&gt;
        return negated;&lt;br /&gt;
    }&lt;br /&gt;
    // Contains&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Is the character specified contained in this range.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * @param ch  the character to check&lt;br /&gt;
     * @return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this range contains the input character&lt;br /&gt;
     */&lt;br /&gt;
    public boolean contains(char ch) {&lt;br /&gt;
        return (ch &amp;gt;= start &amp;amp;&amp;amp; ch &amp;lt;= end) != negated;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Are all the characters of the passed in range contained in&lt;br /&gt;
     * this range.&amp;lt;/p&amp;gt;&lt;br /&gt;
     *&lt;br /&gt;
     * @param range  the range to check against&lt;br /&gt;
     * @return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this range entirely contains the input range&lt;br /&gt;
     * @throws IllegalArgumentException if &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; input&lt;br /&gt;
     */&lt;br /&gt;
    public boolean contains(CharRange range) {&lt;br /&gt;
        if (range == null) {&lt;br /&gt;
            throw new IllegalArgumentException(&amp;quot;The Range must not be null&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        if (negated) {&lt;br /&gt;
            if (range.negated) {&lt;br /&gt;
                return start &amp;gt;= range.start &amp;amp;&amp;amp; end &amp;lt;= range.end;&lt;br /&gt;
            } else {&lt;br /&gt;
                return range.end &amp;lt; start || range.start &amp;gt; end;&lt;br /&gt;
            }&lt;br /&gt;
        } else {&lt;br /&gt;
            if (range.negated) {&lt;br /&gt;
                return start == 0 &amp;amp;&amp;amp; end == Character.MAX_VALUE;&lt;br /&gt;
            } else {&lt;br /&gt;
                return start &amp;lt;= range.start &amp;amp;&amp;amp; end &amp;gt;= range.end;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    // Basics&lt;br /&gt;
    //-----------------------------------------------------------------------&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Compares two CharRange objects, returning true if they represent&lt;br /&gt;
     * exactly the same range of characters defined in the same way.&amp;lt;/p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * @param obj  the object to compare to&lt;br /&gt;
     * @return true if equal&lt;br /&gt;
     */&lt;br /&gt;
    public boolean equals(Object obj) {&lt;br /&gt;
        if (obj == this) {&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
        if (obj instanceof CharRange == false) {&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
        CharRange other = (CharRange) obj;&lt;br /&gt;
        return start == other.start &amp;amp;&amp;amp; end == other.end &amp;amp;&amp;amp; negated == other.negated;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Gets a hashCode compatible with the equals method.&amp;lt;/p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * @return a suitable hashCode&lt;br /&gt;
     */&lt;br /&gt;
    public int hashCode() {&lt;br /&gt;
        return 83 + start + 7 * end + (negated ? 1 : 0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * &amp;lt;p&amp;gt;Gets a string representation of the character range.&amp;lt;/p&amp;gt;&lt;br /&gt;
     * &lt;br /&gt;
     * @return string representation of this range&lt;br /&gt;
     */&lt;br /&gt;
    public String toString() {&lt;br /&gt;
        if (iToString == null) {&lt;br /&gt;
            StringBuffer buf = new StringBuffer(4);&lt;br /&gt;
            if (isNegated()) {&lt;br /&gt;
                buf.append(&amp;quot;^&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            buf.append(start);&lt;br /&gt;
            if (start != end) {&lt;br /&gt;
                buf.append(&amp;quot;-&amp;quot;);&lt;br /&gt;
                buf.append(end);&lt;br /&gt;
            }&lt;br /&gt;
            iToString = buf.toString();&lt;br /&gt;
        }&lt;br /&gt;
        return iToString;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Arrays.copyOf CharSequence ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
import java.util.Arrays;&lt;br /&gt;
public class Copy {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    String[] sa = { &amp;quot;First&amp;quot;, &amp;quot;Second&amp;quot;, &amp;quot;Third&amp;quot; };&lt;br /&gt;
    CharSequence[] csa;&lt;br /&gt;
    csa = Arrays.copyOf(sa, sa.length, CharSequence[].class);&lt;br /&gt;
    for (int i = 0; i &amp;lt; csa.length; i++)&lt;br /&gt;
      System.out.println(csa[i].length());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>