// Decompiled by DJ v2.6.6.51 Copyright 2000 Atanas Neshkov  Date: 10/2/2001 11:00:59
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   com/macromedia/generator/utils/DataSourceTokenizer

package com.macromedia.generator.utils;


// Referenced classes of package com.macromedia.generator.utils:
//            Tokenizer

public class DataSourceTokenizer
{

    public DataSourceTokenizer(String s)
    {
        _fld0141 = false;
        _fld0278 = null;
        _fld0279 = null;
        _fld0141 = s.startsWith("#");
        if(!_fld0141)
        {
            _fld0278 = null;
            s = _mth010C(s);
            _fld0279 = new Tokenizer(s);
            _fld0279.setDelimiter(';');
            _fld0279.setEscape('\0');
            _fld0279.cullEmptyTokens(true);
        } else
        {
            _fld0278 = s;
            _fld0279 = null;
        }
    }

    private String _mth010C(String s)
    {
        String s1 = "";
        int i = s.length();
        for(int j = 0; j < i; j++)
            if(s.startsWith("/n/r", j))
            {
                s1 = s1 + ';';
                j += 3;
            } else
            {
                s1 = s1 + s.charAt(j);
            }

        return s1;
    }

    public String nextDataSource()
    {
        String s = null;
        if(_fld0141)
        {
            s = _fld0278;
            _fld0278 = null;
        } else
        {
            s = _fld0279.nextToken();
        }
        return s;
    }

    private boolean _fld0141;
    private String _fld0278;
    private Tokenizer _fld0279;
}