Clover icon

Coverage Report

  1. Project Clover database Fri Dec 6 2024 13:47:14 GMT
  2. Package org.json.simple.parser

File Yytoken.java

 

Coverage histogram

../../../../img/srcFileCovDistChart1.png
56% of files have more coverage

Code metrics

0
29
2
1
71
51
10
0.34
14.5
2
5

Classes

Class Line # Actions
Yytoken 10 29 10
0.096774199.7%
 

Contributing tests

This file is covered by 93 tests. .

Source view

1    /*
2    * $Id: Yytoken.java,v 1.1 2006/04/15 14:10:48 platform Exp $
3    * Created on 2006-4-15
4    */
5    package org.json.simple.parser;
6   
7    /**
8    * @author FangYidong<fangyidong@yahoo.com.cn>
9    */
 
10    public class Yytoken
11    {
12    public static final int TYPE_VALUE = 0;// JSON primitive value:
13    // string,number,boolean,null
14   
15    public static final int TYPE_LEFT_BRACE = 1;
16   
17    public static final int TYPE_RIGHT_BRACE = 2;
18   
19    public static final int TYPE_LEFT_SQUARE = 3;
20   
21    public static final int TYPE_RIGHT_SQUARE = 4;
22   
23    public static final int TYPE_COMMA = 5;
24   
25    public static final int TYPE_COLON = 6;
26   
27    public static final int TYPE_EOF = -1;// end of file
28   
29    public int type = 0;
30   
31    public Object value = null;
32   
 
33  9342705 toggle public Yytoken(int type, Object value)
34    {
35  9342705 this.type = type;
36  9342705 this.value = value;
37    }
38   
 
39  0 toggle public String toString()
40    {
41  0 StringBuffer sb = new StringBuffer();
42  0 switch (type)
43    {
44  0 case TYPE_VALUE:
45  0 sb.append("VALUE(").append(value).append(")");
46  0 break;
47  0 case TYPE_LEFT_BRACE:
48  0 sb.append("LEFT BRACE({)");
49  0 break;
50  0 case TYPE_RIGHT_BRACE:
51  0 sb.append("RIGHT BRACE(})");
52  0 break;
53  0 case TYPE_LEFT_SQUARE:
54  0 sb.append("LEFT SQUARE([)");
55  0 break;
56  0 case TYPE_RIGHT_SQUARE:
57  0 sb.append("RIGHT SQUARE(])");
58  0 break;
59  0 case TYPE_COMMA:
60  0 sb.append("COMMA(,)");
61  0 break;
62  0 case TYPE_COLON:
63  0 sb.append("COLON(:)");
64  0 break;
65  0 case TYPE_EOF:
66  0 sb.append("END OF FILE");
67  0 break;
68    }
69  0 return sb.toString();
70    }
71    }