Package com.alibaba.fastjson.parser

Examples of com.alibaba.fastjson.parser.SymbolTable$Entry


        Assert.assertTrue("nick \f name" == symbol);
        lexer.close();
    }

    public void test_8() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\n name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick \n name" == symbol);
        lexer.close();
View Full Code Here


        Assert.assertTrue("nick \n name" == symbol);
        lexer.close();
    }

    public void test_9() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\r name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick \r name" == symbol);
        lexer.close();
View Full Code Here

        Assert.assertTrue("nick \r name" == symbol);
        lexer.close();
    }

    public void test_10() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\t name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick \t name" == symbol);
        lexer.close();
View Full Code Here

        Assert.assertTrue("nick \t name" == symbol);
        lexer.close();
    }

    public void test_11() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\u4e2d name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick 中 name" == symbol);
        lexer.close();
View Full Code Here

        Assert.assertTrue("nick 中 name" == symbol);
        lexer.close();
    }

    public void test_12() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner(
                                            "\"\\tabcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("\tabcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890" == symbol);
View Full Code Here

    }

    public void test_error() throws Exception {
        JSONException error = null;
        try {
            SymbolTable symbolTable = new SymbolTable();

            JSONScanner lexer = new JSONScanner("\"nick \\a name\"");
            lexer.scanSymbol(symbolTable, '"');
            lexer.close();
        } catch (JSONException e) {
View Full Code Here

    }

    public void test_error_2() throws Exception {
        JSONException error = null;
        try {
            SymbolTable symbolTable = new SymbolTable();

            JSONScanner lexer = new JSONScanner("\"name");
            lexer.scanSymbol(symbolTable, '"');
            lexer.close();
        } catch (JSONException e) {
View Full Code Here

                String symbol = symbols[i];
                table.findSymbol(symbol.toCharArray(), 0, symbol.length(), symbol.hashCode());
            }
        }

        SymbolTable table = new SymbolTable();
        for (int i = 0; i < symbols.length; ++i) {
            String symbol = symbols[i];
            char[] charArray = symbol.toCharArray();
            table.addSymbol(charArray, 0, charArray.length);
            //System.out.println((table.hash(symbol) & table.getIndexMask()) + "\t\t:" + symbol + "\t\t" + table.hash(symbol));
        }

        String symbol = "name";
        table.addSymbol(symbol.toCharArray(), 0, symbol.length());
        table.addSymbol(symbol.toCharArray(), 0, symbol.length());

        Assert.assertTrue(symbol == table.addSymbol("name".toCharArray(), 0, 4));
        Assert.assertTrue(symbol == table.addSymbol(" name".toCharArray(), 1, 4));
        Assert.assertTrue(symbol == table.addSymbol(" name ".toCharArray(), 1, 4));
        Assert.assertTrue(symbol != table.addSymbol(" namf ".toCharArray(), 1, 4));
    }
View Full Code Here

  }

  @Override
  protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    Entry e = entry(req);
    S3Object remove = map.remove(e);
    if (remove == null) {
      resp.sendError(404, "Not found " + e);
    } else {
      resp.sendError(HttpURLConnection.HTTP_NO_CONTENT, "Deleted");
View Full Code Here

    }

  }

  private Entry entry(HttpServletRequest req) {
    return new Entry(key(uri(req)));
  }
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.parser.SymbolTable$Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.