FileDocCategorySizeDatePackage
BmsgTokenizer.javaAPI DocAndroid 5.1 API2804Thu Mar 12 22:22:50 GMT 2015android.bluetooth.client.map.utils

BmsgTokenizer

public final class BmsgTokenizer extends Object

Fields Summary
private final String
mStr
private final Matcher
mMatcher
private int
mPos
private final int
mOffset
Constructors Summary
public BmsgTokenizer(String str)

        this(str, 0);
    
public BmsgTokenizer(String str, int offset)

        mStr = str;
        mOffset = offset;
        mMatcher = Pattern.compile("(([^:]*):(.*))?\r\n").matcher(str);
        mPos = mMatcher.regionStart();
    
Methods Summary
public android.bluetooth.client.map.utils.BmsgTokenizer$Propertynext(boolean alwaysReturn)

        boolean found = false;

        do {
            mMatcher.region(mPos, mMatcher.regionEnd());

            if (!mMatcher.lookingAt()) {
                if (alwaysReturn) {
                    return null;
                }

                throw new ParseException("Property or empty line expected", pos());
            }

            mPos = mMatcher.end();

            if (mMatcher.group(1) != null) {
                found = true;
            }
        } while (!found);

        return new Property(mMatcher.group(2), mMatcher.group(3));
    
public android.bluetooth.client.map.utils.BmsgTokenizer$Propertynext()

        return next(false);
    
public intpos()

        return mPos + mOffset;
    
public java.lang.Stringremaining()

        return mStr.substring(mPos);