44import java .io .BufferedReader ;
55import java .io .IOException ;
66import java .io .InputStream ;
7- import java .io .InputStreamReader ;
7+ import java .math .BigDecimal ;
8+ import java .math .BigInteger ;
89import java .net .HttpURLConnection ;
910import java .net .MalformedURLException ;
1011import java .net .URL ;
1112import java .util .ArrayList ;
12- import java .util .Collection ;
1313import java .util .Iterator ;
1414import java .util .List ;
1515import java .util .Map ;
@@ -22,6 +22,18 @@ public class Test_JSON extends Test_ {
2222 @ SuppressWarnings ("unused" )
2323 public static void main (String [] args ) {
2424 try {
25+ //
26+ // System.out.println(Double.valueOf(Double.MIN_NORMAL + "1"));
27+ // System.out.println(Long.valueOf(Long.MAX_VALUE+"1"));
28+ // BigInteger bi = new BigInteger(Long.MAX_VALUE+"");
29+ // System.out.println(bi.longValue());
30+ // BigDecimal bd = new BigDecimal(Double.MAX_VALUE + "1");
31+ // System.out.println(bi.doubleValue());
32+
33+
34+ org .json .JSONObject o = new org .json .JSONObject (new Test_JSON ());
35+ System .out .println (o .toString ());
36+
2537 URL url = new URL ("http://www.ebi.ac.uk/pdbe/api/pdb/entry/summary/1cbs" );
2638
2739 JSUtil .setAjax (url );
@@ -88,12 +100,51 @@ public static void main(String[] args) {
88100// for (int i = 0; i < list.size(); i++)
89101// dumpVal(list.get(i));
90102 }
103+
91104 System .out .println ("Test_JSON OK" );
92105 } catch (MalformedURLException e ) {
93106 } catch (IOException e ) {
94107 }
95108 }
96109
110+ public int getValue () {
111+ return 3 ;
112+ }
113+
114+ public double getValueD () {
115+ return 3 ;
116+ }
117+
118+ public boolean getValueBtrue () {
119+ return true ;
120+ }
121+
122+ public boolean getValueBfalse () {
123+ return false ;
124+ }
125+
126+ public String getValueS () {
127+ return "s" ;
128+ }
129+
130+
131+ public char [] getValueCA () {
132+ return new char [] {'o' ,'k' };
133+ }
134+
135+ public BigInteger getValueBI () {
136+ return new BigInteger ("123456789012345678901234567890" );
137+ }
138+
139+ public BigDecimal getValueBD () {
140+ return new BigDecimal ("123456789012345.678901234567890E456" );
141+ }
142+
143+ public BigDecimal getValueLD () {
144+ return new BigDecimal ("123456789012345.678901234567890E-1456" );
145+ }
146+
147+
97148 private static void dumpVal (Object object ) {
98149 if (object instanceof Map ) {
99150 Map <String , Object > m = (Map <String , Object >) object ;
0 commit comments