All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nlab.json.stream.jsonpath.path.PathArrayIndex Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package org.nlab.json.stream.jsonpath.path;

/**
 * Created by nlabrot on 13/04/16.
 */
public class PathArrayIndex extends PathNode {

    private int index;

    public PathArrayIndex(String index) {
        super(null);

        if ("*".equals(index)){
            this.index = -1;
        }else{
            this.index = Integer.parseInt(index);

        }



    }

    public int getIndex() {
        return index;
    }


    public boolean matchIndex(int toMatchIndex){
        return index == -1 || toMatchIndex == index;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy