Source Code Cross Referenced for CharSequence.java in  » 6.0-JDK-Core » lang » java » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » lang » java.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2000-2003 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.lang;
027
028        /**
029         * A <tt>CharSequence</tt> is a readable sequence of <code>char</code> values. This
030         * interface provides uniform, read-only access to many different kinds of
031         * <code>char</code> sequences.
032         * A <code>char</code> value represents a character in the <i>Basic
033         * Multilingual Plane (BMP)</i> or a surrogate. Refer to <a
034         * href="Character.html#unicode">Unicode Character Representation</a> for details.
035         *
036         * <p> This interface does not refine the general contracts of the {@link
037         * java.lang.Object#equals(java.lang.Object) equals} and {@link
038         * java.lang.Object#hashCode() hashCode} methods.  The result of comparing two
039         * objects that implement <tt>CharSequence</tt> is therefore, in general,
040         * undefined.  Each object may be implemented by a different class, and there
041         * is no guarantee that each class will be capable of testing its instances
042         * for equality with those of the other.  It is therefore inappropriate to use
043         * arbitrary <tt>CharSequence</tt> instances as elements in a set or as keys in
044         * a map. </p>
045         *
046         * @author Mike McCloskey
047         * @version 1.15 07/05/05
048         * @since 1.4
049         * @spec JSR-51
050         */
051
052        public interface CharSequence {
053
054            /**
055             * Returns the length of this character sequence.  The length is the number
056             * of 16-bit <code>char</code>s in the sequence.</p>
057             *
058             * @return  the number of <code>char</code>s in this sequence
059             */
060            int length();
061
062            /**
063             * Returns the <code>char</code> value at the specified index.  An index ranges from zero
064             * to <tt>length() - 1</tt>.  The first <code>char</code> value of the sequence is at
065             * index zero, the next at index one, and so on, as for array
066             * indexing. </p>
067             *
068             * <p>If the <code>char</code> value specified by the index is a
069             * <a href="Character.html#unicode">surrogate</a>, the surrogate
070             * value is returned.
071             *
072             * @param   index   the index of the <code>char</code> value to be returned
073             *
074             * @return  the specified <code>char</code> value
075             *
076             * @throws  IndexOutOfBoundsException
077             *          if the <tt>index</tt> argument is negative or not less than
078             *          <tt>length()</tt>
079             */
080            char charAt(int index);
081
082            /**
083             * Returns a new <code>CharSequence</code> that is a subsequence of this sequence.
084             * The subsequence starts with the <code>char</code> value at the specified index and
085             * ends with the <code>char</code> value at index <tt>end - 1</tt>.  The length
086             * (in <code>char</code>s) of the
087             * returned sequence is <tt>end - start</tt>, so if <tt>start == end</tt>
088             * then an empty sequence is returned. </p>
089             * 
090             * @param   start   the start index, inclusive
091             * @param   end     the end index, exclusive
092             *
093             * @return  the specified subsequence
094             *
095             * @throws  IndexOutOfBoundsException
096             *          if <tt>start</tt> or <tt>end</tt> are negative,
097             *          if <tt>end</tt> is greater than <tt>length()</tt>,
098             *          or if <tt>start</tt> is greater than <tt>end</tt>
099             */
100            CharSequence subSequence(int start, int end);
101
102            /**
103             * Returns a string containing the characters in this sequence in the same
104             * order as this sequence.  The length of the string will be the length of
105             * this sequence. </p>
106             *
107             * @return  a string consisting of exactly this sequence of characters
108             */
109            public String toString();
110
111        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.