Source Code Cross Referenced for WrappedT.java in  » Parser » Rats-Parser-Generators » xtc » type » 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 » Parser » Rats Parser Generators » xtc.type 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * xtc - The eXTensible Compiler
003:         * Copyright (C) 2006-2007 Robert Grimm
004:         *
005:         * This program is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU General Public License
007:         * version 2 as published by the Free Software Foundation.
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
012:         * GNU General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU General Public License
015:         * along with this program; if not, write to the Free Software
016:         * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
017:         * USA.
018:         */
019:        package xtc.type;
020:
021:        import xtc.tree.Attribute;
022:        import xtc.tree.Location;
023:
024:        /**
025:         * The superclass of all wrapped types.  A wrapped type adds (mostly)
026:         * symbolic information to another, more basic type.
027:         *
028:         * @author Robert Grimm
029:         * @version $Revision: 1.36 $
030:         */
031:        public abstract class WrappedT extends Type {
032:
033:            /** The actual type. */
034:            private Type type;
035:
036:            /**
037:             * Create a new wrapped type.
038:             *
039:             * @param type The actual type.
040:             */
041:            public WrappedT(Type type) {
042:                this .type = type;
043:            }
044:
045:            /**
046:             * Create a new wrapped type.
047:             *
048:             * @param template The type whose annotations to copy.
049:             * @param type The actual type.
050:             */
051:            public WrappedT(Type template, Type type) {
052:                super (template);
053:                this .type = type;
054:            }
055:
056:            public Type seal() {
057:                if (!isSealed()) {
058:                    super .seal();
059:                    type.seal();
060:                }
061:                return this ;
062:            }
063:
064:            public Type.Tag tag() {
065:                return type.tag();
066:            }
067:
068:            public boolean isWrapped() {
069:                return true;
070:            }
071:
072:            public WrappedT toWrapped() {
073:                return this ;
074:            }
075:
076:            public boolean hasLocation(boolean forward) {
077:                Location loc = super .getLocation(false);
078:                return null != loc ? true : forward ? type.hasLocation(true)
079:                        : false;
080:            }
081:
082:            public Location getLocation(boolean forward) {
083:                Location loc = super .getLocation(false);
084:                return null != loc ? loc : forward ? type.getLocation(true)
085:                        : null;
086:            }
087:
088:            public boolean hasLanguage(boolean forward) {
089:                return null != language ? true : forward ? type
090:                        .hasLanguage(true) : false;
091:            }
092:
093:            public Language getLanguage(boolean forward) {
094:                return null != language ? language : forward ? type
095:                        .getLanguage(true) : null;
096:            }
097:
098:            public boolean hasScope(boolean forward) {
099:                return null != scope ? true : forward ? type.hasScope(true)
100:                        : false;
101:            }
102:
103:            public String getScope(boolean forward) {
104:                return null != scope ? scope : forward ? type.getScope(true)
105:                        : null;
106:            }
107:
108:            public boolean hasConstant(boolean forward) {
109:                return null != constant ? true : forward ? type
110:                        .hasConstant(true) : false;
111:            }
112:
113:            public Constant getConstant(boolean forward) {
114:                return null != constant ? constant : forward ? type
115:                        .getConstant(true) : null;
116:            }
117:
118:            public boolean hasShape(boolean forward) {
119:                return null != shape ? true : forward ? type.hasShape(true)
120:                        : false;
121:            }
122:
123:            public Reference getShape(boolean forward) {
124:                return null != shape ? shape : forward ? type.getShape(true)
125:                        : null;
126:            }
127:
128:            public boolean hasAttribute(Attribute att, boolean forward) {
129:                return (null != attributes) && attributes.contains(att) ? true
130:                        : forward ? type.hasAttribute(att, true) : false;
131:            }
132:
133:            public Attribute getAttribute(String name, boolean forward) {
134:                Attribute att = Attribute.get(name, attributes);
135:                return null != att ? att : forward ? type.getAttribute(name,
136:                        true) : null;
137:            }
138:
139:            /**
140:             * Get the type.
141:             *
142:             * @return The type.
143:             */
144:            public Type getType() {
145:                return type;
146:            }
147:
148:            /**
149:             * Set the type.
150:             *
151:             * @param type The type.
152:             * @throws IllegalStateException Signals that this type is sealed.
153:             */
154:            public void setType(Type type) {
155:                checkNotSealed();
156:                this .type = type;
157:            }
158:
159:            public boolean hasAnnotated() {
160:                return type.hasAnnotated();
161:            }
162:
163:            public AnnotatedT toAnnotated() {
164:                return type.toAnnotated();
165:            }
166:
167:            public boolean hasAlias() {
168:                return type.hasAlias();
169:            }
170:
171:            public AliasT toAlias() {
172:                return type.toAlias();
173:            }
174:
175:            public boolean hasEnum() {
176:                return type.hasEnum();
177:            }
178:
179:            public EnumT toEnum() {
180:                return type.toEnum();
181:            }
182:
183:            public boolean hasEnumerator() {
184:                return type.hasEnumerator();
185:            }
186:
187:            public EnumeratorT toEnumerator() {
188:                return type.toEnumerator();
189:            }
190:
191:            public boolean hasVariable() {
192:                return type.hasVariable();
193:            }
194:
195:            public boolean hasInstantiated() {
196:                return type.hasInstantiated();
197:            }
198:
199:            public InstantiatedT toInstantiated() {
200:                return type.toInstantiated();
201:            }
202:
203:            public boolean hasParameterized() {
204:                return type.hasParameterized();
205:            }
206:
207:            public ParameterizedT toParameterized() {
208:                return type.toParameterized();
209:            }
210:
211:            public VariableT toVariable() {
212:                return type.toVariable();
213:            }
214:
215:            public boolean hasTagged() {
216:                return type.hasTagged();
217:            }
218:
219:            public Tagged toTagged() {
220:                return type.toTagged();
221:            }
222:
223:            public Type resolve() {
224:                return type.resolve();
225:            }
226:
227:            /**
228:             * Get this type's hash code.  This method forwards the method
229:             * invocation to the wrapped type.
230:             *
231:             * @return The hash code.
232:             */
233:            public int hashCode() {
234:                return type.hashCode();
235:            }
236:
237:            /**
238:             * Determine whether this type equals the specified object.  This
239:             * method forwards the method invocation to the wrapped type.
240:             *
241:             * @param o The object.
242:             * @return <code>true</code> if this type equals the object.
243:             */
244:            public boolean equals(Object o) {
245:                return getType().equals(o);
246:            }
247:
248:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.