范型JAVA
2001-12-30 15:36
323 查看
GJ is an extension of the Java programming language that supports generic types.
Support for generics. Many data types are generic over some other data type, and this is especially common for reusable libraries such as collection classes. GJ supports the use of such types, for instance allowing one to write the GJ type Vector<String> as opposed to the Java type Vector. With GJ, fewer casts are required, and the compiler catches more errors.
Superset of the Java programming language. Every Java source program is still legal and retains the same meaning in GJ. The GJ compiler can be used as a Java compiler.
Compiles into the Java Virtual Machine. GJ compiles into JVM code, so GJ programs run on any Java platform, including Java compliant browsers. Class files produced by the GJ compiler can be freely mixed with those produced by other Java compilers.
Compatible with existing libraries. One can call any Java library function from GJ, and any GJ library function from Java. Further, where it is sensible, one can assign GJ types to existing Java libraries. For instance, the GJ type Vector<String> is implemented by the Java library type Vector.
Efficient translation. GJ is translated by erasure: no information about type parameters is maintained at run-time. This means GJ code is pretty much identical to Java code for the same purpose, and equally efficient.
Freely available and fully documented. The GJ compiler is itself written in GJ, so it runs on any platform that supports Java. The GJ compiler is available for download, and there is extensive documentation.
Related work. There are several related attempts to add generic types to Java, including our previous work on Pizza. GJ differs from these in that it places a premium on compatibility with old Java programs, which is important to developers that want to evolve smoothly from Java to GJ.
GJ was designed by Gilad Bracha of JavaSoft, Martin Odersky of the University of South Australia, David Stoutamire of JavaSoft, and Philip Wadler of Bell Labs, Lucent Technologies. Although JavaSoft employees contributed to its design, GJ is not a product of JavaSoft or Sun Microsystems and neither JavaSoft nor Sun Microsystems makes any claims regarding it.
Sun maintains a Bug Parade where users can vote to give feedback on which shortcomings in Java they would like to see fixed. A request to add generics to Java is bug number 4064105, and is in The Top Twenty-five Requests for Enhancements.
(You need to register with Sun's Java developer connection to follow the above links.)
Support for generics. Many data types are generic over some other data type, and this is especially common for reusable libraries such as collection classes. GJ supports the use of such types, for instance allowing one to write the GJ type Vector<String> as opposed to the Java type Vector. With GJ, fewer casts are required, and the compiler catches more errors.
Superset of the Java programming language. Every Java source program is still legal and retains the same meaning in GJ. The GJ compiler can be used as a Java compiler.
Compiles into the Java Virtual Machine. GJ compiles into JVM code, so GJ programs run on any Java platform, including Java compliant browsers. Class files produced by the GJ compiler can be freely mixed with those produced by other Java compilers.
Compatible with existing libraries. One can call any Java library function from GJ, and any GJ library function from Java. Further, where it is sensible, one can assign GJ types to existing Java libraries. For instance, the GJ type Vector<String> is implemented by the Java library type Vector.
Efficient translation. GJ is translated by erasure: no information about type parameters is maintained at run-time. This means GJ code is pretty much identical to Java code for the same purpose, and equally efficient.
Freely available and fully documented. The GJ compiler is itself written in GJ, so it runs on any platform that supports Java. The GJ compiler is available for download, and there is extensive documentation.
Related work. There are several related attempts to add generic types to Java, including our previous work on Pizza. GJ differs from these in that it places a premium on compatibility with old Java programs, which is important to developers that want to evolve smoothly from Java to GJ.
GJ was designed by Gilad Bracha of JavaSoft, Martin Odersky of the University of South Australia, David Stoutamire of JavaSoft, and Philip Wadler of Bell Labs, Lucent Technologies. Although JavaSoft employees contributed to its design, GJ is not a product of JavaSoft or Sun Microsystems and neither JavaSoft nor Sun Microsystems makes any claims regarding it.
Sun proposes to add generic types to Java
Sun has put forward a proposal to Add Generic Types To The Java Programming Language as part of the Java Community Process. GJ is one of the leading proposals being considered. The process is spearheaded by Gilad Bracha, one of the GJ designers.Sun maintains a Bug Parade where users can vote to give feedback on which shortcomings in Java they would like to see fixed. A request to add generics to Java is bug number 4064105, and is in The Top Twenty-five Requests for Enhancements.
(You need to register with Sun's Java developer connection to follow the above links.)
相关文章推荐
- Java范型深入理解,利用反射穿透编译器忽略范型
- Java范型浅析
- Java Comparator的范型类型推导问题
- Java范型随笔
- Java 数组转型和范型
- Java 范型中的super和extends的区别
- Java编程之范型
- Java范型深入理解,利用反射穿透编译器忽略范型
- Java范型
- Java 数组转型和范型
- java 范型编程的简单测试。
- Java 数组转型和范型
- 范型在java中的应用
- java 的范型的研究 与.net作比较
- 由Cannot create a generic array of ArrayList<xx>引出的学习--Java范型
- Java 数组转型和范型
- 深入理解java范型
- java 范型详解
- Java千百问_05面向对象(014)_如何获取范型的类Class
- java基础 -范型的学习