Debian Codegraph @

rhino/testsrc/tests/src/com/netscape/javascript/qa/lc3/jsnull/Null_001.java

raw symbols SCIP
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 package com.netscape.javascript.qa.lc3.jsnull;
6
7 /**
8 * 3.4 Preferred Argument Conversions
9 * 3.4.1 null
10 *
11 * The JavaScript value of undefined can be passed to methods that expect
12 * any class or interface type.
13 *
14 * It is an error if undefined is passed to an ambiguous method (the object
15 * contains methods that accept either a java.lang.String or java.lang.Object).
16 *
17 * You should be able to call the ambiguous methods explicitly using the
18 * Explicit Method invocation.
19 *
20 */
21
22 public class Null_001 {
23 public String BOOLEAN = "BOOLEAN";
24 public String BOOLEAN_OBJECT = "BOOLEAN_OBJECT";
25 public String OBJECT = "OBJECT";
26 public String STRING = "STRING";
27 public String LONG = "LONG";
28 public String INT = "INT";
29 public String SHORT = "SHORT";
30 public String CHAR = "CHAR";
31 public String BYTE = "BYTE";
32 public String DOUBLE = "DOUBLE";
33 public String FLOAT = "FLOAT";
34
35
36
37 public String ambiguous( float arg ) {
38 return FLOAT;
39 }
40
41 public String ambiguous( double arg ) {
42 return DOUBLE;
43 }
44
45 public String ambiguous( byte arg ) {
46 return BYTE;
47 }
48
49 public String ambiguous( char arg ) {
50 return CHAR;
51 }
52
53 public String ambiguous( short arg ) {
54 return SHORT;
55 }
56
57 public String ambiguous( int arg ) {
58 return INT;
59 }
60
61 public String ambiguous( long arg ) {
62 return LONG;
63 }
64
65 public String ambiguous( String arg ) {
66 return STRING;
67 }
68
69 public String ambiguous( Object arg ) {
70 return OBJECT;
71 }
72
73 public String ambiguous( Boolean arg ) {
74 return BOOLEAN_OBJECT;
75 }
76
77 public static String STATIC_BOOLEAN_OBJECT = "STATIC_BOOLEAN_OBJECT";
78 public static String STATIC_STRING = "STATIC_STRING";
79 public static String STATIC_OBJECT = "STATIC_OBJECT";
80
81 public static String staticAmbiguous( Boolean arg ) {
82 return STATIC_BOOLEAN_OBJECT;
83 }
84
85 public static String staticAmbiguous( String arg ) {
86 return STATIC_STRING;
87 }
88
89 public static String staticAmbiguous( Object arg ) {
90 return STATIC_OBJECT;
91 }
92
93 }