Code example for Queue

Methods: peek, poll

0
                        getTargetTableName()); 
    } 
 
    private String extractTargetTableName(Queue<String> tokens) throws SQLException {
        /* Dropping UPDATE token */ 
        tokens.poll();
        if (!Constants.TABLE.equals(tokens.peek())) {
            throw new SQLException("Syntax Error : 'TABLE' keyword is expected");
        } 
        tokens.poll();
        if (!ParserUtil.isStringLiteral(tokens.peek())) {
            throw new SQLException("Syntax Error : String literal is expected");
        } 
        return tokens.poll();
    } 
 
    private ColumnInfo[] extractUpdatedColumns(Queue<String> tokens) throws SQLException {
        /* Dropping SET token */ 
        tokens.poll();
        List<ColumnInfo> updatedColumns = new ArrayList<ColumnInfo>();
        this.processUpdatedColumns(tokens, updatedColumns, 0);