Source Code Cross Referenced for Gap.java in  » IDE » DrJava » edu » rice » cs » drjava » model » definitions » reducedmodel » 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 » IDE » DrJava » edu.rice.cs.drjava.model.definitions.reducedmodel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*BEGIN_COPYRIGHT_BLOCK
002:         *
003:         * Copyright (c) 2001-2007, JavaPLT group at Rice University (javaplt@rice.edu)
004:         * All rights reserved.
005:         * 
006:         * Redistribution and use in source and binary forms, with or without
007:         * modification, are permitted provided that the following conditions are met:
008:         *    * Redistributions of source code must retain the above copyright
009:         *      notice, this list of conditions and the following disclaimer.
010:         *    * Redistributions in binary form must reproduce the above copyright
011:         *      notice, this list of conditions and the following disclaimer in the
012:         *      documentation and/or other materials provided with the distribution.
013:         *    * Neither the names of DrJava, the JavaPLT group, Rice University, nor the
014:         *      names of its contributors may be used to endorse or promote products
015:         *      derived from this software without specific prior written permission.
016:         * 
017:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
018:         * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
019:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
020:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
021:         * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
022:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
023:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
024:         * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
025:         * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
026:         * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
027:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028:         *
029:         * This software is Open Source Initiative approved Open Source Software.
030:         * Open Source Initative Approved is a trademark of the Open Source Initiative.
031:         * 
032:         * This file is part of DrJava.  Download the current version of this project
033:         * from http://www.drjava.org/ or http://sourceforge.net/projects/drjava/
034:         * 
035:         * END_COPYRIGHT_BLOCK*/
036:
037:        package edu.rice.cs.drjava.model.definitions.reducedmodel;
038:
039:        /** A subclass of ReducedToken that represents sequences of non-special characters.
040:         *  @version $Id: Gap.java 4255 2007-08-28 19:17:37Z mgricken $
041:         */
042:        class Gap extends ReducedToken {
043:            private int _size;
044:
045:            /** Creates a new Gap.
046:             *  @param size the size of the gap
047:             *  @param state the state of the reduced model
048:             */
049:            Gap(int size, ReducedModelState state) {
050:                super (state);
051:                _size = size;
052:            }
053:
054:            /** Gets the size of this gap.
055:             *  @return _size
056:             */
057:            public int getSize() {
058:                return _size;
059:            }
060:
061:            /** Gets the token type.
062:             *  @return the empty string
063:             */
064:            public String getType() {
065:                return "";
066:            }
067:
068:            /** Blows up.  The type of a Gap cannot be set.
069:             *  @param type the type to set to
070:             *  @throws RuntimeException always
071:             */
072:            public void setType(String type) {
073:                throw new RuntimeException("Can't set type on Gap!");
074:            }
075:
076:            /** Blows up.  A Gap cannot be flipped.
077:             *  @throws RuntimeException always
078:             */
079:            public void flip() {
080:                throw new RuntimeException("Can't flip a Gap!");
081:            }
082:
083:            /** Increases the size of the gap.
084:             *  @param delta the amount by which the gap is augmented.
085:             */
086:            public void grow(int delta) {
087:                if (delta >= 0)
088:                    _size += delta;
089:            }
090:
091:            /** Decreases the size of the gap.
092:             *  @param delta the amount by which the gap is diminished.
093:             */
094:            public void shrink(int delta) {
095:                if ((delta <= _size) && (delta >= 0))
096:                    _size -= delta;
097:            }
098:
099:            /** Converts a Brace to a String.  Used for debugging.
100:             *  @return the String representation of the Brace
101:             */
102:            public String toString() {
103:                //    String val = "Gap(size: "+_size+"): ";
104:                final StringBuilder val = new StringBuilder();
105:                int i;
106:                for (i = 0; i < _size; i++)
107:                    val.append(" _");
108:                return val.toString();
109:            }
110:
111:            /** Determines that this is not a multi-char brace.
112:             *  @return <code>false</code>
113:             */
114:            public boolean isMultipleCharBrace() {
115:                return false;
116:            }
117:
118:            /** Determines that this is a gap.
119:             *  @return <code>true</code>
120:             */
121:            public boolean isGap() {
122:                return true;
123:            }
124:
125:            /** Determines that this is not a line comment.
126:             *  @return <code>false</code>
127:             */
128:            public boolean isLineComment() {
129:                return false;
130:            }
131:
132:            /** Determines that this is not the start of a block comment.
133:             *  @return <code>false</code>
134:             */
135:            public boolean isBlockCommentStart() {
136:                return false;
137:            }
138:
139:            /** Determines that this is not the end of a block comment.
140:             *  @return <code>false</code>
141:             */
142:            public boolean isBlockCommentEnd() {
143:                return false;
144:            }
145:
146:            /** Determines that this is not a newline.
147:             *  @return <code>false</code>
148:             */
149:            public boolean isNewline() {
150:                return false;
151:            }
152:
153:            /** Determines that this is not a /.
154:             *  @return <code>false</code>
155:             */
156:            public boolean isSlash() {
157:                return false;
158:            }
159:
160:            /** Determines that this is not a *.
161:             *  @return <code>false</code>
162:             */
163:            public boolean isStar() {
164:                return false;
165:            }
166:
167:            /** Determines that this is not a ".
168:             *  @return <code>false</code>
169:             */
170:            public boolean isDoubleQuote() {
171:                return false;
172:            }
173:
174:            /** Determines that this is not a '.
175:             *  @return <code>false</code>
176:             */
177:            public boolean isSingleQuote() {
178:                return false;
179:            }
180:
181:            /** Determines that this is not a double escape sequence.
182:             *  @return <code>false</code>
183:             */
184:            public boolean isDoubleEscapeSequence() {
185:                return false;
186:            }
187:
188:            /** Determines that this is not a double escape.
189:             *  @return <code>false</code>
190:             */
191:            public boolean isDoubleEscape() {
192:                return false;
193:            }
194:
195:            /** Determines that this is not a \'.
196:             *  @return <code>false</code>
197:             */
198:            public boolean isEscapedSingleQuote() {
199:                return false;
200:            }
201:
202:            /** Determines that this is not a \".
203:             *  @return <code>false</code>
204:             */
205:            public boolean isEscapedDoubleQuote() {
206:                return false;
207:            }
208:
209:            /** Determines that this is not open.
210:             *  @return <code>false</code>
211:             */
212:            public boolean isOpen() {
213:                return false;
214:            }
215:
216:            /** Determines that this is not closed. */
217:            public boolean isClosed() {
218:                return false;
219:            }
220:
221:            /** Determines that this is not a match.
222:             *  @param other the token to compare to
223:             *  @return <code>false</code>
224:             */
225:            public boolean isMatch(Brace other) {
226:                return false;
227:            }
228:
229:            /** Determines that this ReducedToken is not matchable (one of "{", "}", "(", ")", "[", "]") */
230:            public boolean isMatchable() {
231:                return false;
232:            }
233:
234:            /** Determines that this is not an open brace. */
235:            public boolean isOpenBrace() {
236:                return false;
237:            }
238:
239:            /** Determines that this is not a closed brace. */
240:            public boolean isClosedBrace() {
241:                return false;
242:            }
243:        }
w__w_w___.j___ava___2___s__.___co__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.