A Type-Passing Approach for the Implementation of Parametric Methods in Java
نویسنده
چکیده
class List { Object head; List tail; List(Object head, List tail){ this.head=head; this.tail=tail; } void setHead(Object head){this.head=head;} void setTail(List tail){this.tail=tail;} Object getHead(){ return head;} List getTail(){ return tail;} void setIfPossible(Object o){ if ($snip1(o)) head=$snip2(o); } abstract boolean $snip1(Object o); abstract Object $snip2(Object o);boolean $snip1(Object o); abstract Object $snip2(Object o); } interface $List$_String_${} class $$List$_String_$ extends List implements $List$_String_${ $$List$_String_$(Object head, List tail){ super(head,tail); } boolean $snip1(Object o){ return o instanceof String; } Object $snip2(Object o){ return (String)o;} } // Object o=new List("1",null); Object o=new $$List$_String_$("1",null); // List l=(List)o; List l=(List)(($List$_String_$)o); FIGURE 3. NextGen translation of class List. by the GJ compiler. However, from the draft specification on generics released [26], it is clear that Sun is open to having future versions of the compiler extending the current implementation of GJ so as to tackle the issue of exact types. In fact, some solutions have been proposed to avoid the problem. Basically, they extend the behaviour of GJ so that the necessary information on the instantiation of the type parameters is somehow accessible at run-time. In this way, these proposals are able to apply type-casts and instance tests to parametric types and type variables as well, supporting the true integration of parametric polymorphism in Java.
منابع مشابه
Comparing two testing procedures in unbalanced two-way ANOVA models under heteroscedasticity: Approximate degree of freedom and parametric bootstrap approach
The classic F-test is usually used for testing the effects of factors in homoscedastic two-way ANOVA models. However, the assumption of equal cell variances is usually violated in practice. In recent years, several test procedures have been proposed for testing the effects of factors. In this paper, the two methods that are approximate degree of freedom (ADF) and parametric bootstr...
متن کاملEvaluation Approaches of Value at Risk for Tehran Stock Exchange
The purpose of this study is estimation of daily Value at Risk (VaR) for total index of Tehran Stock Exchange using parametric, nonparametric and semi-parametric approaches. Conditional and unconditional coverage backtesting are used for evaluating the accuracy of calculated VaR and also to compare the performance of mentioned approaches. In most cases, based on backtesting statistics Results, ...
متن کاملJava Message Passing Package - A Design and Implementation of MPI in Java
We present a design and an implementation of the MPI (Message Passing Interface) standard in the Java language, called JMPP (Java Message Passing Package). Our implementation is not an interface from the Java language to existing MPI libraries. Rather, the implementation is completely coded in Java. Therefore, JMPP maintains the platform-independence property of Java. Furthermore, JMPP enhances...
متن کاملSystem Engineering Implementation Process for Super-Systems
System engineering is one of the most powerful tools for comprehensive project management and control. This tool emphasized the life cycle of the projects, manages every single activity and helps manage the main elements of the project through a set of management and engineering processes. The goal of the current study is to use a system engineering approach in design phase in order or to meet ...
متن کاملDeXteR- An Extensible Framework for Declarative Parameter Passing in Distributed Object Systems
In modern distributed object systems, reference parameters are passed to a remote method based on their runtime type. We argue that such type-based parameter passing is limiting with respect to expressiveness, readability, and maintainability, and that parameter passing semantics should be decoupled from parameter types. We present declarative parameter passing, an approach that fully decouples...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Comput. J.
دوره 46 شماره
صفحات -
تاریخ انتشار 2003