Source Code Cross Referenced for RegExpResult.java in  » Scripting » oscript-2.10.4 » oscript » data » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » oscript 2.10.4 » oscript.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*=============================================================================
002:         *     Copyright Texas Instruments 2003-2004.  All Rights Reserved.
003:         *   
004:         * This program is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         * 
009:         * This program is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         * 
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         * 
018:         * $ProjectHeader: OSCRIPT 0.155 Fri, 20 Dec 2002 18:34:22 -0800 rclark $
019:         */
020:
021:        package oscript.data;
022:
023:        import oscript.exceptions.*;
024:        import oscript.*;
025:
026:        /**
027:         * The result of executing a pattern against a string.  This object acts
028:         * both as an object and as an array with the following properties and
029:         * indicies:
030:         * <div id="regtable"><table>
031:         *   <tr>
032:         *     <th>Property/Index</th>
033:         *     <th>Description</th>
034:         *   </tr>
035:         *   <tr>
036:         *     <td>property: <code>index</code></td>
037:         *     <td>the index of the matched string</td>
038:         *   </tr>
039:         *   <tr>
040:         *     <td>property: <code>input</code></td>
041:         *     <td>the original string</td>
042:         *   </tr>
043:         *   <tr>
044:         *     <td>index: <code>0</code></td>
045:         *     <td>the last matched characters</td>
046:         *   </tr>
047:         *   <tr>
048:         *     <td>index: <code>1</code> thru <code>n</code></td>
049:         *     <td>The parenthesized substring matches, if any</td>
050:         *   </tr>
051:         * </table></div>
052:         * Note 1: this API is modeled after the JavaScript RegExp API, for the 
053:         * benefit of users already familiar with JavaScript.
054:         * <p>
055:         * Note 2: the properties (<code>index</code>, etc) work by bean-access,
056:         * so they are implemented by getter methods (since they are read-only)
057:         * 
058:         * @author Rob Clark (rob@ti.com)
059:         */
060:        public abstract class RegExpResult extends OObject {
061:            public final static Value TYPE = BuiltinType
062:                    .makeBuiltinType("oscript.data.RegExpResult");
063:            public final static String PARENT_TYPE_NAME = "oscript.data.OObject";
064:            public final static String TYPE_NAME = "RegExpResult";
065:            public final static String[] MEMBER_NAMES = new String[] {
066:                    "getType", "castToJavaObject", "castToString",
067:                    "bopInstanceOf", "bopEquals", "bopNotEquals", "getMember",
068:                    "elementAt", "length", "getIndex", "getInput", "index",
069:                    "input"
070:            // XXX
071:            };
072:
073:            /**
074:             * The input string, whose match results are contained in this object
075:             */
076:            private Value input;
077:
078:            /*=======================================================================*/
079:            /**
080:             * Class Constructor.
081:             * 
082:             * @param input   the string to match the regular expression against
083:             */
084:            protected RegExpResult(Value input) {
085:                super ();
086:                this .input = input;
087:            }
088:
089:            /*=======================================================================*/
090:            /**
091:             * Get the type of this object.  The returned type doesn't have to take
092:             * into account the possibility of a script type extending a built-in
093:             * type, since that is handled by {@link #getType}.
094:             * 
095:             * @return the object's type
096:             */
097:            protected Value getTypeImpl() {
098:                return TYPE;
099:            }
100:
101:            /*=======================================================================*/
102:            /**
103:             * Get the original input string.
104:             */
105:            public Value getInput() {
106:                return input;
107:            }
108:
109:            /*=======================================================================*/
110:            /**
111:             * The index of the match in the string, or <code>-1</code> if no match.
112:             */
113:            public abstract Value getIndex();
114:
115:            /*=======================================================================*/
116:            /**
117:             * For types that implement <code>elementAt</code>, this returns the
118:             * number of elements.
119:             * 
120:             * @return an integer length
121:             * @throws PackagedScriptObjectException(NoSuchMemberException)
122:             * @see #elementAt
123:             * @see #elementsAt
124:             */
125:            public abstract int length() throws PackagedScriptObjectException;
126:
127:            /*=======================================================================*/
128:            /**
129:             * Get the specified index of this object, if this object is an array.  If
130:             * needed, the array is grown to the appropriate size.
131:             * 
132:             * @param idx          the index to get
133:             * @return a reference to the member
134:             * @throws PackagedScriptObjectException(NoSuchMemberException)
135:             * @see #length
136:             * @see #elementsAt
137:             */
138:            public abstract Value elementAt(Value idx)
139:                    throws PackagedScriptObjectException;
140:        }
141:
142:        /*
143:         *   Local Variables:
144:         *   tab-width: 2
145:         *   indent-tabs-mode: nil
146:         *   mode: java
147:         *   c-indentation-style: java
148:         *   c-basic-offset: 2
149:         *   eval: (c-set-offset 'substatement-open '0)
150:         *   eval: (c-set-offset 'case-label '+)
151:         *   eval: (c-set-offset 'inclass '+)
152:         *   eval: (c-set-offset 'inline-open '0)
153:         *   End:
154:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.