Java Doc for Identifier.java in  » 6.0-JDK-Modules-sun » tools » sun » tools » java » 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 » 6.0 JDK Modules sun » tools » sun.tools.java 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sun.tools.java.Identifier

Identifier
final public class Identifier implements Constants(Code)
A class to represent identifiers.

An identifier instance is very similar to a String. The difference is that identifier can't be instanciated directly, instead they are looked up in a hash table. This means that identifiers with the same name map to the same identifier object. This makes comparisons of identifiers much faster.

A lot of identifiers are qualified, that is they have '.'s in them. Each qualified identifier is chopped up into the qualifier and the name. The qualifier is cached in the value field.

Unqualified identifiers can have a type. This type is an integer that can be used by a scanner as a token value. This value has to be set using the setType method.

WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
author:
   Arthur van Hoff
version:
   1.31, 05/05/07



Field Summary
final public static  charINNERCLASS_PREFIX
     A space character, which precedes the first inner class name in a qualified name, and thus marks the qualification as involving inner classes, instead of merely packages.

Ex: java.util.Vector.

static  Hashtablehash
    
 Stringname
    
 TypetypeObject
     The Type which corresponds to this Identifier.
 Objectvalue
     The value of the identifier, for keywords this is an instance of class Integer, for qualified names this is another identifier (the qualifier).


Method Summary
public  IdentifieraddAmbigPrefix()
     Add ambigPrefix to `this' to make a new Identifier marked as ambiguous.
public  IdentifiergetFlatName()
     Return the class name, without its qualifier, and with any nesting flattened into a new qualfication structure. If the original identifier is inner, the result will be qualified, and can be further decomposed by means of getQualifier and getName.

For example:

 Identifier id = Identifier.lookup("pkg.Foo.
public  IdentifiergetHead()
     Yet another way to slice qualified identifiers: The head of an identifier is its first qualifier component, and the tail is the rest of them.
public  IdentifiergetName()
     Return the unqualified name.
public  IdentifiergetQualifier()
     Return the qualifier.
public  IdentifiergetTail()
    
public  IdentifiergetTopName()
    
 intgetType()
     Get the type of the identifier.
public  booleanhasAmbigPrefix()
     Determine whether an Identifier has been marked as ambiguous.
public  booleanisInner()
     Check if the name is inner (ie: it contains a ' ').
public  booleanisQualified()
     Check if the name is qualified (ie: it contains a '.').
public static synchronized  Identifierlookup(String s)
     Lookup an identifier.
public static  Identifierlookup(Identifier q, Identifier n)
     Lookup a qualified identifier.
public static  IdentifierlookupInner(Identifier c, Identifier n)
     Lookup an inner identifier.
public  IdentifierremoveAmbigPrefix()
     Remove the ambigPrefix from `this' to get the original identifier.
 voidsetType(int t)
     Set the type of the identifier.
public  StringtoString()
     Convert to a string.

Field Detail
INNERCLASS_PREFIX
final public static char INNERCLASS_PREFIX(Code)
A space character, which precedes the first inner class name in a qualified name, and thus marks the qualification as involving inner classes, instead of merely packages.

Ex: java.util.Vector. Enumerator.




hash
static Hashtable hash(Code)
The hashtable of identifiers



name
String name(Code)
The name of the identifier



typeObject
Type typeObject(Code)
The Type which corresponds to this Identifier. This is used as cache for Type.tClass() and shouldn't be used outside of that context.



value
Object value(Code)
The value of the identifier, for keywords this is an instance of class Integer, for qualified names this is another identifier (the qualifier).





Method Detail
addAmbigPrefix
public Identifier addAmbigPrefix()(Code)
Add ambigPrefix to `this' to make a new Identifier marked as ambiguous. It is important that this new Identifier not refer to an existing class.



getFlatName
public Identifier getFlatName()(Code)
Return the class name, without its qualifier, and with any nesting flattened into a new qualfication structure. If the original identifier is inner, the result will be qualified, and can be further decomposed by means of getQualifier and getName.

For example:

 Identifier id = Identifier.lookup("pkg.Foo. Bar");
 id.getName().name      =>  "Foo. Bar"
 id.getFlatName().name  =>  "Foo.Bar"
 



getHead
public Identifier getHead()(Code)
Yet another way to slice qualified identifiers: The head of an identifier is its first qualifier component, and the tail is the rest of them.



getName
public Identifier getName()(Code)
Return the unqualified name. In the case of an inner name, the unqualified name will itself contain components.



getQualifier
public Identifier getQualifier()(Code)
Return the qualifier. The null identifier is returned if the name was not qualified. The qualifier does not include any inner part of the name.



getTail
public Identifier getTail()(Code)

See Also:   getHead



getTopName
public Identifier getTopName()(Code)



getType
int getType()(Code)
Get the type of the identifier.



hasAmbigPrefix
public boolean hasAmbigPrefix()(Code)
Determine whether an Identifier has been marked as ambiguous.



isInner
public boolean isInner()(Code)
Check if the name is inner (ie: it contains a ' ').



isQualified
public boolean isQualified()(Code)
Check if the name is qualified (ie: it contains a '.').



lookup
public static synchronized Identifier lookup(String s)(Code)
Lookup an identifier.



lookup
public static Identifier lookup(Identifier q, Identifier n)(Code)
Lookup a qualified identifier.



lookupInner
public static Identifier lookupInner(Identifier c, Identifier n)(Code)
Lookup an inner identifier. (Note: n can be idNull.)



removeAmbigPrefix
public Identifier removeAmbigPrefix()(Code)
Remove the ambigPrefix from `this' to get the original identifier.



setType
void setType(int t)(Code)
Set the type of the identifier.



toString
public String toString()(Code)
Convert to a string.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.