Search in sources :

Example 1 with FNBoolean

use of org.sirix.service.xml.xpath.functions.sequences.FNBoolean in project sirix by sirixdb.

the class Function method ebv.

public static boolean ebv(final Axis axis) throws SirixXPathException {
    final FuncDef ebv = FuncDef.BOOLEAN;
    final List<Axis> param = new ArrayList<Axis>();
    param.add(axis);
    final AbstractAxis bAxis = new FNBoolean(axis.getTrx(), param, ebv.getMin(), ebv.getMax(), axis.getTrx().keyForName(ebv.getReturnType()));
    if (bAxis.hasNext()) {
        bAxis.next();
        final boolean result = Boolean.parseBoolean(bAxis.getTrx().getValue());
        if (!bAxis.hasNext()) {
            bAxis.reset(axis.getTrx().getNodeKey());
            return result;
        }
    }
    // TODO!!
    throw new IllegalStateException("This should not happen!");
}
Also used : FNBoolean(org.sirix.service.xml.xpath.functions.sequences.FNBoolean) ArrayList(java.util.ArrayList) AbstractAxis(org.sirix.service.xml.xpath.AbstractAxis) Axis(org.sirix.api.Axis) AbstractAxis(org.sirix.service.xml.xpath.AbstractAxis)

Aggregations

ArrayList (java.util.ArrayList)1 Axis (org.sirix.api.Axis)1 AbstractAxis (org.sirix.service.xml.xpath.AbstractAxis)1 FNBoolean (org.sirix.service.xml.xpath.functions.sequences.FNBoolean)1