{
        return (OppoBaseTextureView) ColorTypeCastingHelper.typeCasting(OppoBaseTextureView.class, textureView);
    }

package com.color.inner.view;

import android.util.Log;
import android.view.OppoBaseTextureView;
import android.view.TextureView;
import com.color.util.ColorTypeCastingHelper;

public class TextureViewWrapper {

    private static final String TAG = "TextureViewWrapper";

    public static void setCallBackSizeChangeWhenLayerUpdate(TextureView view, boolean doCallBack) {
        try {
            typeCasting(view).setCallBackSizeChangeWhenLayerUpdate(doCallBack);
        } catch (Exception e) {
            Log.e(TAG, e.toString());
        }
    }

    private static OppoBaseTextureView typeCasting(TextureView textureView)


package com.color.inner.view;

import android.util.Log;
import android.view.OppoBaseTextureView;
import android.view.TextureView;
import com.color.util.ColorTypeCastingHelper;

public class TextureViewWrapper {

    private static final String TAG = "TextureViewWrapper";

    public static void setCallBackSizeChangeWhenLayerUpdate(TextureView view, boolean doCallBack) {
        try {
            typeCasting(view).setCallBackSizeChangeWhenLayerUpdate(doCallBack);
        } catch (Exception e) {
            Log.e(TAG, e.toString());
        }
    }

    private static OppoBaseTextureView typeCasting(TextureView textureView) {
        return (OppoBaseTextureView) ColorTypeCastingHelper.typeCasting(OppoBaseTextureView.class, textureVi


try {
            typeCasting(view).setCallBackSizeChangeWhenLayerUpdate(doCallBack);
        } catch (Exception e) {
            Log.e(TAG, e.toString());
        }

package com.color.inner.view;

import android.util.Log;
import android.view.OppoBaseTextureView;
import android.view.TextureView;
import com.color.util.ColorTypeCastingHelper;

public class TextureViewWrapper {

    private static final String TAG = "TextureViewWrapper";

    public static void setCallBackSizeChangeWhenLayerUpdate(TextureView view, boolean doCallBack) {

    }

    private static OppoBaseTextureView typeCasting(TextureView textureView) {
        return (OppoBaseTextureView) ColorTypeCastingHelper.typeCasting(OppoBaseTextureView.class, textureView);
    }
}


default <ENTITY, RETURN> Criteria<ENTITY, RETURN> createCriteria(final EntityManager entityManager, final Class<ENTITY> entityClass, final Class<RETURN> returnClass)

/*
 * JPAstreamer - Express JPA queries with Java Streams
 *
 *
 * See: http://example.com
 */
package com.speedment.jpastreamer.criteria;

import static java.util.Objects.requireNonNull;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

/**
 * @author Mislav Milicevic
 * @since 0.0.9
 */
public interface CriteriaFactory {

    /**
     * Creates and returns a {@code Criteria} containing the provided {@code builder},
     * {@code query} and {@code root}.
     *
     * @param builder to store in the {@code Criteria}
     * @param query to store in the {@code Criteria}
     * @param root to store in the {@code Criteria}
     * @param <ENTITY> root entity
     * @param <RETURN> type returned by the query
     * @return a {@code Criteria} containing the provided {@code builder},
     *         {@code query} and {@code root}
     */
    <ENTITY, RETURN> Criteria<ENTITY, RETURN> createCriteria(final CriteriaBuilder builder, final CriteriaQuery<RETURN> query, final Root<ENTITY> root);

    /**
     * Creates and returns a {@code Criteria} where the {@code CriteriaBuilder},
     * {@code CriteriaQuery} and {@code Root} are created by the provided {@code entityManager}.
     *
     * @param entityManager used to create the necessary {@code Criteria} objects
     * @param entityClass used to define the result model of the stored query and root
     * @param <ENTITY> root entity
     * @return a {@code Criteria}
     */
    default <ENTITY> Criteria<ENTITY, ENTITY> createCriteria(final EntityManager entityManager, final Class<ENTITY> entityClass) {
        return createCriteria(entityManager, entityClass, entityClass);
    }

    /**
     * Creates and returns a {@code Criteria} where the {@code CriteriaBuilder},
     * {@code CriteriaQuery} and {@code Root} are created by the provided {@code entityManager}.
     *
     * @param entityManager used to create the necessary {@code Criteria} objects
     * @param entityClass used to define the result model of the root
     * @param returnClass used to define the result model of the query
     * @param <ENTITY> root entity
     * @param <RETURN> query return entity
     * @return a {@code Criteria}
     */

{
        requireNonNull(entityManager);
        requireNonNull(entityClass);
        requireNonNull(returnClass);
        final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
        final CriteriaQuery<RETURN> criteriaQuery = criteriaBuilder.createQuery(returnClass);
        final Root<ENTITY> root = criteriaQuery.from(entityClass);
        return createCriteria(criteriaBuilder, criteriaQuery, root);
    }
}


{
        return createCriteria(entityManager, entityClass, entityClass);
    }

/*
 * JPAstreamer - Express JPA queries with Java Streams
 *
 *
 * See: http://example.com
 */
package com.speedment.jpastreamer.criteria;

import static java.util.Objects.requireNonNull;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

/**
 * @author Mislav Milicevic
 * @since 0.0.9
 */
public interface CriteriaFactory {

    /**
     * Creates and returns a {@code Criteria} containing the provided {@code builder},
     * {@code query} and {@code root}.
     *
     * @param builder to store in the {@code Criteria}
     * @param query to store in the {@code Criteria}
     * @param root to store in the {@code Criteria}
     * @param <ENTITY> root entity
     * @param <RETURN> type returned by the query
     * @return a {@code Criteria} containing the provided {@code builder},
     *         {@code query} and {@code root}
     */
    <ENTITY, RETURN> Criteria<ENTITY, RETURN> createCriteria(final CriteriaBuilder builder, final CriteriaQuery<RETURN> query, final Root<ENTITY> root);

    /**
     * Creates and returns a {@code Criteria} where the {@code CriteriaBuilder},
     * {@code CriteriaQuery} and {@code Root} are created by the provided {@code entityManager}.
     *
     * @param entityManager used to create the necessary {@code Criteria} objects
     * @param entityClass used to define the result model of the stored query and root
     * @param <ENTITY> root entity
     * @return a {@code Criteria}
     */
    default <ENTITY> Criteria<ENTITY, ENTITY> createCriteria(final EntityManager entityManager, final Class<ENTITY> entityClass)

    /**
     * Creates and returns a {@code Criteria} where the {@code CriteriaBuilder},
     * {@code CriteriaQuery} and {@code Root} are created by the provided {@code entityManager}.
     *
     * @param entityManager used to create the necessary {@code Criteria} objects
     * @param entityClass used to define the result model of the root
     * @param returnClass used to define the result model of the query
     * @param <ENTITY> root entity
     * @param <RETURN> query return entity
     * @return a {@code Criteria}
     */
    default <ENTITY, RETURN> Criteria<ENTITY, RETURN> createCriteria(final EntityManager entityManager, final Class<ENTITY> entityClass, final Class<RETURN> returnClass) {
        requireNonNull(entityManager);
        requireNonNull(entityClass);
        requireNonNull(returnClass);
        final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
        final CriteriaQuery<RETURN> criteriaQuery = criteriaBuilder.createQuery(returnClass);
        final Root<ENTITY> root = criteriaQuery.from(entityClass);
        return createCriteria(criteriaBuilder, criteriaQuery, root);
    }
}


/*
 * JPAstreamer - Express JPA queries with Java Streams
 *
 *
 * See: http://example.com
 */
package com.speedment.jpastreamer.criteria;

import static java.util.Objects.requireNonNull;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

/**
 * @author Mislav Milicevic
 * @since 0.0.9
 */
public interface CriteriaFactory {

    /**
     * Creates and returns a {@code Criteria} containing the provided {@code builder},
     * {@code query} and {@code root}.
     *
     * @param builder to store in the {@code Criteria}
     * @param query to store in the {@code Criteria}
     * @param root to store in the {@code Criteria}
     * @param <ENTITY> root entity
     * @param <RETURN> type returned by the query
     * @return a {@code Criteria} containing the provided {@code builder},
     *         {@code query} and {@code root}
     */
    <ENTITY, RETURN> Criteria<ENTITY, RETURN> createCriteria(final CriteriaBuilder builder, final CriteriaQuery<RETURN> query, final Root<ENTITY> root);

    /**
     * Creates and returns a {@code Criteria} where the {@code CriteriaBuilder},
     * {@code CriteriaQuery} and {@code Root} are created by the provided {@code entityManager}.
     *
     * @param entityManager used to create the necessary {@code Criteria} objects
     * @param entityClass used to define the result model of the stored query and root
     * @param <ENTITY> root entity
     * @return a {@code Criteria}
     */
    default <ENTITY> Criteria<ENTITY, ENTITY> createCriteria(final EntityManager entityManager, final Class<ENTITY> entityClass) {
        return createCriteria(entityManager, entityClass, entityClass);
    }

    /**
     * Creates and returns a {@code Criteria} where the {@code CriteriaBuilder},
     * {@code CriteriaQuery} and {@code Root} are created by the provided {@code entityManager}.
     *
     * @param entityManager used to create the necessary {@code Criteria} objects
     * @param entityClass used to define the result model of the root
     * @param returnClass used to define the result model of the query
     * @param <ENTITY> root entity
     * @param <RETURN> query return entity
     * @return a {@code Criteria}
     */
    default <ENTITY, RETURN> Criteria<ENTITY, RETURN> createCriteria(final EntityManager entityManager, final Class<ENTITY> entityClass, final Class<RETURN> returnClass) {
        requireNonNull(entityManager);
        requireNonNull(entityClass);
        requi

        final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
        final CriteriaQuery<RETURN> criteriaQuery = criteriaBuilder.createQuery(returnClass);
        final Root<ENTITY> root = criteriaQuery.from(entityClass);
        return createCriteria(criteriaBuilder, criteriaQuery, root);
    }
}


default <ENTITY> Criteria<ENTITY, ENTITY> createCriteria(final EntityManager entityManager, final Class<ENTITY> entityClass) {
        return createCriteria(entityManager, entityClass, entityClass);
    }

/*
 * JPAstreamer - Express JPA queries with Java Streams
 *
 *
 * See: http://example.com
 */
package com.speedment.jpastreamer.criteria;

import static java.util.Objects.requireNonNull;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

/**
 * @author Mislav Milicevic
 * @since 0.0.9
 */
public interface CriteriaFactory {

    /**
     * Creates and returns a {@code Criteria} containing the provided {@code builder},
     * {@code query} and {@code root}.
     *
     * @param builder to store in the {@code Criteria}
     * @param query to store in the {@code Criteria}
     * @param root to store in the {@code Criteria}
     * @param <ENTITY> root entity
     * @param <RETURN> type returned by the query
     * @return a {@code Criteria} containing the provided {@code builder},
     *         {@code query} and {@code root}
     */
    <ENTITY, RETURN> Criteria<ENTITY, RETURN> createCriteria(final CriteriaBuilder builder, final CriteriaQuery<RETURN> query, final Root<ENTITY> root);

    /**
     * Creates and returns a {@code Criteria} where the {@code CriteriaBuilder},
     * {@code CriteriaQuery} and {@code Root} are created by the provided {@code entityManager}.
     *
     * @param entityManager used to create the necessary {@code Criteria} objects
     * @param entityClass used to define the result model of the stored query and root
     * @param <ENTITY> root entity
     * @return a {@code Criteria}
     */


package module85packageJava0;

import java.lang.Integer;

public class Foo44 {

    Integer int0;

    public void foo0() {
        new module85packageJava0.Foo43().foo4();
    }

    public void foo1() {
        foo0();
    }

{
        foo1();
    }

    public void foo3() {
        foo2();
    }

    public void foo4() {
        foo3();
    }
}


package module85packageJava0;

import java.lang.Integer;

public class Foo44 {

    Integer int0;

    public void foo0() {
        new module85packageJava0.Foo43().foo4();
    }

    public void foo1()

    public void foo2() {
        foo1();
    }

    public void foo3() {
        foo2();
    }

    public void foo4() {
        foo3();
    }
}


package module85packageJava0;

import java.lang.Integer;

public class Foo44 {

    Integer int0;

    public void foo0() {
        new module85packageJava0.Foo43().foo4();
    }

    public void foo1() {
        foo0();
    }

    public void foo2() {
        foo

    }

    public void foo3() {
        foo2();
    }

    public void foo4() {
        foo3();
    }
}


package edu.jas.integrate;

import edu.jas.arith.BigRational;
import edu.jas.kern.ComputerThreads;
import edu.jas.poly.GenPolynomial;
import edu.jas.poly.GenPolynomialRing;
import edu.jas.poly.PolyUtil;
import edu.jas.poly.TermOrder;
import edu.jas.ufd.Quotient;
import edu.jas.ufd.QuotientRing;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Quotient over BigRational GenPolynomial tests with JUnit. Test Lazard Rioboo
 * algorithm.
 * @author Heinz Kredel
 */
public class ElementaryIntegrationLazardTest extends TestCase {

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }

    /**
     * Constructs a ElementaryIntegrationLazardTest object.
     * @param name String.
     */
    public ElementaryIntegrationLazardTest(String name) {
        super(name);
    }

    public static Test suite() {
        TestSuite suite = new TestSuite(ElementaryIntegrationLazardTest.class);
        return suite;
    }

    TermOrder tord;

    QuotientRing<BigRational> qfac;

    GenPolynomialRing<BigRational> mfac;

    ElementaryIntegration<BigRational> integrator;

    QuotIntegral<BigRational> rint;

    Quotient<BigRational> a;

    Quotient<BigRational> b;

    Quotient<BigRational> c;

    Quotient<BigRational> d;

    Quotient<BigRational> e;

    // only univariate polynomials
    int rl = 1;

    int kl = 5;

    int ll = 3;

    int el = 4;

    float q = 0.4f;

{
        a = b = c = d = e = null;
        tord = new TermOrder(TermOrder.INVLEX);
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        mfac = new GenPolynomialRing<BigRational>(br, rl, tord, vars);
        qfac = new QuotientRing<BigRational>(mfac);
        integrator = new ElementaryIntegrationLazard<BigRational>(br);
    }

    @Override
    protected void tearDown() {
        a = b = c = d = e = null;
        qfac = null;
        ComputerThreads.terminate();
    }

    public void testRational() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + 2 * i, el + i, q);
            b = integrator.deriviative(a);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test 1/p pure logarithm integral.
     */
    public void testPureLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test p'/p pure logarithm integral.
     */
    public void testPureLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            b = new Quotient<BigRational>(qfac, pp, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p logarithm integral.
     */
    public void testRationalWithLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            e = b.sum(c);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with 1/p logarithm integral.
     */
    public void xtestRationalWithLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p + 1/p logarithm integral.
     */
    public void testRationalWithLogarithm() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(c).sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test rational integral with quotient coefficients.
     */
    public void testRationalRecursive() {
        QuotientRing<Quotient<BigRational>> qqfac;
        GenPolynomialRing<Quotient<BigRational>> qmfac;
        ElementaryIntegration<Quotient<BigRational>> qintegrator;
        QuotIntegral<Quotient<BigRational>> qrint;
        String[] vars = new String[] { "y" };
        qmfac = new GenPolynomialRing<Quotient<BigRational>>(qfac, 1, tord, vars);
        qqfac = new QuotientRing<Quotient<BigRational>>(qmfac);
        qintegrator = new ElementaryIntegration<Quotient<BigRational>>(qfac);
        Quotient<Quotient<BigRational>> qa, qb;
        for (int i = 0; i < 2; i++) {
            qa = qqfac.random(2, ll, el, q);
            qb = qintegrator.deriviative(qa);
            qrint = qintegrator.integrate(qb);
            assertTrue("isIntegral ", qintegrator.isIntegral(qrint));
        }
    }

    /**
     * Test mixed rational integral.
     */
    public void testMixedRational() {
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        GenPolynomialRing<BigRational> pfac = new GenPolynomialRing<BigRational>(br, vars);
        QuotientRing<BigRational> qfac = new QuotientRing<BigRational>(pfac);
        GenPolynomial<BigRational> n = pfac.parse("(3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2)");
        GenPolynomial<BigRational> d = pfac.parse("(4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4)");
        Quotient<BigRational> a = new Quotient<BigRational>(qfac, n, d);
        QuotIntegral<BigRational> rint = integrator.integrate(a);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
        Quotient<BigRational> b = qfac.parse("{ 3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2 | 4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4 }");
        assertEquals("a == b: ", a, b);
        rint = integrator.integrate(b);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
    }
}


{
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + 2 * i, el + i, q);
            b = integrator.deriviative(a);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

package edu.jas.integrate;

import edu.jas.arith.BigRational;
import edu.jas.kern.ComputerThreads;
import edu.jas.poly.GenPolynomial;
import edu.jas.poly.GenPolynomialRing;
import edu.jas.poly.PolyUtil;
import edu.jas.poly.TermOrder;
import edu.jas.ufd.Quotient;
import edu.jas.ufd.QuotientRing;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Quotient over BigRational GenPolynomial tests with JUnit. Test Lazard Rioboo
 * algorithm.
 * @author Heinz Kredel
 */
public class ElementaryIntegrationLazardTest extends TestCase {

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }

    /**
     * Constructs a ElementaryIntegrationLazardTest object.
     * @param name String.
     */
    public ElementaryIntegrationLazardTest(String name) {
        super(name);
    }

    public static Test suite() {
        TestSuite suite = new TestSuite(ElementaryIntegrationLazardTest.class);
        return suite;
    }

    TermOrder tord;

    QuotientRing<BigRational> qfac;

    GenPolynomialRing<BigRational> mfac;

    ElementaryIntegration<BigRational> integrator;

    QuotIntegral<BigRational> rint;

    Quotient<BigRational> a;

    Quotient<BigRational> b;

    Quotient<BigRational> c;

    Quotient<BigRational> d;

    Quotient<BigRational> e;

    // only univariate polynomials
    int rl = 1;

    int kl = 5;

    int ll = 3;

    int el = 4;

    float q = 0.4f;

    @Override
    protected void setUp() {
        a = b = c = d = e = null;
        tord = new TermOrder(TermOrder.INVLEX);
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        mfac = new GenPolynomialRing<BigRational>(br, rl, tord, vars);
        qfac = new QuotientRing<BigRational>(mfac);
        integrator = new ElementaryIntegrationLazard<BigRational>(br);
    }

    @Override
    protected void tearDown() {
        a = b = c = d = e = null;
        qfac = null;
        ComputerThreads.terminate();
    }

    public void testRational()

    /**
     * Test 1/p pure logarithm integral.
     */
    public void testPureLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test p'/p pure logarithm integral.
     */
    public void testPureLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            b = new Quotient<BigRational>(qfac, pp, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p logarithm integral.
     */
    public void testRationalWithLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            e = b.sum(c);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with 1/p logarithm integral.
     */
    public void xtestRationalWithLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p + 1/p logarithm integral.
     */
    public void testRationalWithLogarithm() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(c).sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test rational integral with quotient coefficients.
     */
    public void testRationalRecursive() {
        QuotientRing<Quotient<BigRational>> qqfac;
        GenPolynomialRing<Quotient<BigRational>> qmfac;
        ElementaryIntegration<Quotient<BigRational>> qintegrator;
        QuotIntegral<Quotient<BigRational>> qrint;
        String[] vars = new String[] { "y" };
        qmfac = new GenPolynomialRing<Quotient<BigRational>>(qfac, 1, tord, vars);
        qqfac = new QuotientRing<Quotient<BigRational>>(qmfac);
        qintegrator = new ElementaryIntegration<Quotient<BigRational>>(qfac);
        Quotient<Quotient<BigRational>> qa, qb;
        for (int i = 0; i < 2; i++) {
            qa = qqfac.random(2, ll, el, q);
            qb = qintegrator.deriviative(qa);
            qrint = qintegrator.integrate(qb);
            assertTrue("isIntegral ", qintegrator.isIntegral(qrint));
        }
    }

    /**
     * Test mixed rational integral.
     */
    public void testMixedRational() {
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        GenPolynomialRing<BigRational> pfac = new GenPolynomialRing<BigRational>(br, vars);
        QuotientRing<BigRational> qfac = new QuotientRing<BigRational>(pfac);
        GenPolynomial<BigRational> n = pfac.parse("(3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2)");
        GenPolynomial<BigRational> d = pfac.parse("(4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4)");
        Quotient<BigRational> a = new Quotient<BigRational>(qfac, n, d);
        QuotIntegral<BigRational> rint = integrator.integrate(a);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
        Quotient<BigRational> b = qfac.parse("{ 3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2 | 4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4 }");
        assertEquals("a == b: ", a, b);
        rint = integrator.integrate(b);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
    }
}


package edu.jas.integrate;

import edu.jas.arith.BigRational;
import edu.jas.kern.ComputerThreads;
import edu.jas.poly.GenPolynomial;
import edu.jas.poly.GenPolynomialRing;
import edu.jas.poly.PolyUtil;
import edu.jas.poly.TermOrder;
import edu.jas.ufd.Quotient;
import edu.jas.ufd.QuotientRing;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Quotient over BigRational GenPolynomial tests with JUnit. Test Lazard Rioboo
 * algorithm.
 * @author Heinz Kredel
 */
public class ElementaryIntegrationLazardTest extends TestCase {

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }

    /**
     * Constructs a ElementaryIntegrationLazardTest object.
     * @param name String.
     */
    public ElementaryIntegrationLazardTest(String name) {
        super(name);
    }

    public static Test suite() {
        TestSuite suite = new TestSuite(ElementaryIntegrationLazardTest.class);
        return suite;
    }

    TermOrder tord;

    QuotientRing<BigRational> qfac;

    GenPolynomialRing<BigRational> mfac;

    ElementaryIntegration<BigRational> integrator;

    QuotIntegral<BigRational> rint;

    Quotient<BigRational> a;

    Quotient<BigRational> b;

    Quotient<BigRational> c;

    Quotient<BigRational> d;

    Quotient<BigRational> e;

    // only univariate polynomials
    int rl = 1;

    int kl = 5;

    int ll = 3;

    int el = 4;

    float q = 0.4f;

    @Override
    protected void setUp() {
        a = b = c = d = e = null;
        tord = new TermOrder(TermOrder.INVLEX);
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        mfac = new GenPolynomialRing<BigRational>(br, rl, tord, vars);
        qfac = new QuotientRing<BigRational>(mfac);
        integrator = new ElementaryIntegrationLazard<BigRational>(br);
    }

    @Override
    protected void tearDown() {
        a = b = c = d = e = null;
        qfac = null;
        ComputerThreads.terminate();
    }

    public void testRational() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + 2 * i, el + i, q);
            b = integrator.deriviative(a);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test 1/p pure logarithm integral.
     */
    public void testPureLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test p'/p pure logarithm integral.
     */
    public void testPureLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            b = new Quotient<BigRational>(qfac, pp, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p logarithm integral.
     */
    public void testRationalWithLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            e = b.sum(c);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with 1/p logarithm integral.
     */
    public void xtestRationalWithLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p + 1/p logarithm integral.
     */
    public void testRationalWithLogarithm() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(c).sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test rational integral with quotient coefficients.
     */
    public void testRationalRecursive() {
        QuotientRing<Quotient<BigRational>> qqfac;
        GenPolynomialRing<Quotient<BigRational>> qmfac;
        ElementaryIntegration<Quotient<BigRational>> qintegrator;
        QuotIntegral<Quotient<BigRational>> qrint;
        String[] vars = new String[] { "y" };
        qmfac = new GenPolynomialRing<Quotient<BigRational>>(qfac, 1, tord, vars);
        qqfac = new QuotientRing<Quotient<BigRational>>(qmfac);
        qintegrator = new ElementaryIntegration<Quotient<BigRational>>(qfac);
        Quotient<Quotient<BigRational>> qa, qb;
        for (int i = 0; i < 2; i++) {
            qa = qqfac.random(2, ll, el, q);
            qb = qintegrator.deriviative(qa);
            qrint = qintegrator.integrate(qb);
            assertTrue("isIntegral ", qintegrator.isIntegral(qrint));
        }
    }

    /**
     * Test mixed rational integral.
     */
    public void testMixedRational() {
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        GenPolynomialRing<BigRational> pfac = new GenPolynomialRing<BigRational>(br, vars);
        QuotientRing<BigRational> qfac = new QuotientRing<BigRational>(pfac);
        GenPolynomial<BigRational> n = pfac.parse("(3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2)");
        GenPolynomial<BigRational> d = pfac.parse("(4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4)");
        Quotient<BigRational> a = new Quotient<BigRational>(qfac, n, d);
        QuotIntegral<BigRat


public void testPureLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

package edu.jas.integrate;

import edu.jas.arith.BigRational;
import edu.jas.kern.ComputerThreads;
import edu.jas.poly.GenPolynomial;
import edu.jas.poly.GenPolynomialRing;
import edu.jas.poly.PolyUtil;
import edu.jas.poly.TermOrder;
import edu.jas.ufd.Quotient;
import edu.jas.ufd.QuotientRing;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Quotient over BigRational GenPolynomial tests with JUnit. Test Lazard Rioboo
 * algorithm.
 * @author Heinz Kredel
 */
public class ElementaryIntegrationLazardTest extends TestCase {

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }

    /**
     * Constructs a ElementaryIntegrationLazardTest object.
     * @param name String.
     */
    public ElementaryIntegrationLazardTest(String name) {
        super(name);
    }

    public static Test suite() {
        TestSuite suite = new TestSuite(ElementaryIntegrationLazardTest.class);
        return suite;
    }

    TermOrder tord;

    QuotientRing<BigRational> qfac;

    GenPolynomialRing<BigRational> mfac;

    ElementaryIntegration<BigRational> integrator;

    QuotIntegral<BigRational> rint;

    Quotient<BigRational> a;

    Quotient<BigRational> b;

    Quotient<BigRational> c;

    Quotient<BigRational> d;

    Quotient<BigRational> e;

    // only univariate polynomials
    int rl = 1;

    int kl = 5;

    int ll = 3;

    int el = 4;

    float q = 0.4f;

    @Override
    protected void setUp() {
        a = b = c = d = e = null;
        tord = new TermOrder(TermOrder.INVLEX);
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        mfac = new GenPolynomialRing<BigRational>(br, rl, tord, vars);
        qfac = new QuotientRing<BigRational>(mfac);
        integrator = new ElementaryIntegrationLazard<BigRational>(br);
    }

    @Override
    protected void tearDown() {
        a = b = c = d = e = null;
        qfac = null;
        ComputerThreads.terminate();
    }

    public void testRational() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + 2 * i, el + i, q);
            b = integrator.deriviative(a);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test 1/p pure logarithm integral.
     */

    /**
     * Test p'/p pure logarithm integral.
     */
    public void testPureLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            b = new Quotient<BigRational>(qfac, pp, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p logarithm integral.
     */
    public void testRationalWithLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            e = b.sum(c);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with 1/p logarithm integral.
     */
    public void xtestRationalWithLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p + 1/p logarithm integral.
     */
    public void testRationalWithLogarithm() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(c).sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test rational integral with quotient coefficients.
     */
    public void testRationalRecursive() {
        QuotientRing<Quotient<BigRational>> qqfac;
        GenPolynomialRing<Quotient<BigRational>> qmfac;
        ElementaryIntegration<Quotient<BigRational>> qintegrator;
        QuotIntegral<Quotient<BigRational>> qrint;
        String[] vars = new String[] { "y" };
        qmfac = new GenPolynomialRing<Quotient<BigRational>>(qfac, 1, tord, vars);
        qqfac = new QuotientRing<Quotient<BigRational>>(qmfac);
        qintegrator = new ElementaryIntegration<Quotient<BigRational>>(qfac);
        Quotient<Quotient<BigRational>> qa, qb;
        for (int i = 0; i < 2; i++) {
            qa = qqfac.random(2, ll, el, q);
            qb = qintegrator.deriviative(qa);
            qrint = qintegrator.integrate(qb);
            assertTrue("isIntegral ", qintegrator.isIntegral(qrint));
        }
    }

    /**
     * Test mixed rational integral.
     */
    public void testMixedRational() {
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        GenPolynomialRing<BigRational> pfac = new GenPolynomialRing<BigRational>(br, vars);
        QuotientRing<BigRational> qfac = new QuotientRing<BigRational>(pfac);
        GenPolynomial<BigRational> n = pfac.parse("(3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2)");
        GenPolynomial<BigRational> d = pfac.parse("(4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4)");
        Quotient<BigRational> a = new Quotient<BigRational>(qfac, n, d);
        QuotIntegral<BigRational> rint = integrator.integrate(a);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
        Quotient<BigRational> b = qfac.parse("{ 3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2 | 4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4 }");
        assertEquals("a == b: ", a, b);
        rint = integrator.integrate(b);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
    }
}


for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }

package edu.jas.integrate;

import edu.jas.arith.BigRational;
import edu.jas.kern.ComputerThreads;
import edu.jas.poly.GenPolynomial;
import edu.jas.poly.GenPolynomialRing;
import edu.jas.poly.PolyUtil;
import edu.jas.poly.TermOrder;
import edu.jas.ufd.Quotient;
import edu.jas.ufd.QuotientRing;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Quotient over BigRational GenPolynomial tests with JUnit. Test Lazard Rioboo
 * algorithm.
 * @author Heinz Kredel
 */
public class ElementaryIntegrationLazardTest extends TestCase {

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }

    /**
     * Constructs a ElementaryIntegrationLazardTest object.
     * @param name String.
     */
    public ElementaryIntegrationLazardTest(String name) {
        super(name);
    }

    public static Test suite() {
        TestSuite suite = new TestSuite(ElementaryIntegrationLazardTest.class);
        return suite;
    }

    TermOrder tord;

    QuotientRing<BigRational> qfac;

    GenPolynomialRing<BigRational> mfac;

    ElementaryIntegration<BigRational> integrator;

    QuotIntegral<BigRational> rint;

    Quotient<BigRational> a;

    Quotient<BigRational> b;

    Quotient<BigRational> c;

    Quotient<BigRational> d;

    Quotient<BigRational> e;

    // only univariate polynomials
    int rl = 1;

    int kl = 5;

    int ll = 3;

    int el = 4;

    float q = 0.4f;

    @Override
    protected void setUp() {
        a = b = c = d = e = null;
        tord = new TermOrder(TermOrder.INVLEX);
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        mfac = new GenPolynomialRing<BigRational>(br, rl, tord, vars);
        qfac = new QuotientRing<BigRational>(mfac);
        integrator = new ElementaryIntegrationLazard<BigRational>(br);
    }

    @Override
    protected void tearDown() {
        a = b = c = d = e = null;
        qfac = null;
        ComputerThreads.terminate();
    }

    public void testRational() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + 2 * i, el + i, q);
            b = integrator.deriviative(a);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test 1/p pure logarithm integral.
     */
    public void testPureLogarithm1() {

    }

    /**
     * Test p'/p pure logarithm integral.
     */
    public void testPureLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            b = new Quotient<BigRational>(qfac, pp, a.den);
            rint = integrator.integrate(b);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p logarithm integral.
     */
    public void testRationalWithLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            e = b.sum(c);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with 1/p logarithm integral.
     */
    public void xtestRationalWithLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test mixed rational with p'/p + 1/p logarithm integral.
     */
    public void testRationalWithLogarithm() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll + i, el + i, q);
            b = integrator.deriviative(a);
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational>baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp, a.den);
            d = new Quotient<BigRational>(qfac, qfac.getONE().num, a.den);
            e = b.sum(c).sum(d);
            rint = integrator.integrate(e);
            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }

    /**
     * Test rational integral with quotient coefficients.
     */
    public void testRationalRecursive() {
        QuotientRing<Quotient<BigRational>> qqfac;
        GenPolynomialRing<Quotient<BigRational>> qmfac;
        ElementaryIntegration<Quotient<BigRational>> qintegrator;
        QuotIntegral<Quotient<BigRational>> qrint;
        String[] vars = new String[] { "y" };
        qmfac = new GenPolynomialRing<Quotient<BigRational>>(qfac, 1, tord, vars);
        qqfac = new QuotientRing<Quotient<BigRational>>(qmfac);
        qintegrator = new ElementaryIntegration<Quotient<BigRational>>(qfac);
        Quotient<Quotient<BigRational>> qa, qb;
        for (int i = 0; i < 2; i++) {
            qa = qqfac.random(2, ll, el, q);
            qb = qintegrator.deriviative(qa);
            qrint = qintegrator.integrate(qb);
            assertTrue("isIntegral ", qintegrator.isIntegral(qrint));
        }
    }

    /**
     * Test mixed rational integral.
     */
    public void testMixedRational() {
        BigRational br = new BigRational(1);
        String[] vars = new String[] { "x" };
        GenPolynomialRing<BigRational> pfac = new GenPolynomialRing<BigRational>(br, vars);
        QuotientRing<BigRational> qfac = new QuotientRing<BigRational>(pfac);
        GenPolynomial<BigRational> n = pfac.parse("(3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2)");
        GenPolynomial<BigRational> d = pfac.parse("(4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4)");
        Quotient<BigRational> a = new Quotient<BigRational>(qfac, n, d);
        QuotIntegral<BigRational> rint = integrator.integrate(a);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
        Quotient<BigRational> b = qfac.parse("{ 3*x^16-19*x^15+43*x^14-20*x^13-91*x^12+183*x^11-81*x^10-166*x^9+271*x^8-101*x^7-127*x^6+168*x^5-53*x^4-31*x^3+41*x^2-2*x-2 | 4*x^14-20*x^13+28*x^12+24*x^11-108*x^10+84*x^9+76*x^8-176*x^7+76*x^6+84*x^5-108*x^4+24*x^3+28*x^2-20*x+4 }");
        assertEquals("a == b: ", a, b);
        rint = integrator.integrate(b);
        assertTrue("isIntegral ", integrator.isIntegral(rint));
    }
}


{
        if (nums == null || nums.length == 0) {
            return 0;
        }
        int count = 0;
        int end = 0;
        int maxPosition = 0;
        for (int i = 0; i < nums.length - 1; i++) {
            if (nums[i] + i > maxPosition) {
                maxPosition = nums[i] + i;
            }
            if (i == end) {
                end = maxPosition;
                count++;
            }
        }
        return count;
    }
}


{
        if (nums == null || nums.length == 0) {
            return 0;
        }
        int count = 0;
        int end = 0;
        int maxPosition = 0;
        for (int i = 0; i < nums.length - 1; i++) {
            if (nums[i] + i > maxPosition) {
                maxPosition = nums[i] + i;
            }
            if (i == end) {
                end = maxPosition;
                count++;
            }
        }
        return count;
    }

class Solution {

    // greedy
    public int jump(int[] nums)


class Solution {

    // greedy
    public int jump(int[] nums) {
        if (nums == null || nums.length == 0) {
            return 0;
        }
        int count = 0;
        int end =

        int maxPosition = 0;
        for (int i = 0; i < nums.length - 1; i++) {
            if (nums[i] + i > maxPosition) {
                maxPosition = nums[i] + i;
            }
            if (i == end) {
                end = maxPosition;
                count++;
            }
        }
        return count;
    }
}


for (int i = 0; i < nums.length - 1; i++) {
            if (nums[i] + i > maxPosition) {
                maxPosition = nums[i] + i;
            }
            if (i == end) {
                end = maxPosition;
                count++;
            }
        }

class Solution {

    // greedy
    public int jump(int[] nums) {
        if (nums == null || nums.length == 0) {
            return 0;
        }
        int count = 0;
        int end = 0;
        int maxPosition = 0;


QueryReformulator loadQueryReformulator() throws OBDASpecificationException;

package it.unibz.inf.ontop.injection;

import it.unibz.inf.ontop.answering.reformulation.QueryReformulator;
import it.unibz.inf.ontop.answering.reformulation.input.InputQueryFactory;
import it.unibz.inf.ontop.exception.OBDASpecificationException;

public interface OntopReformulationConfiguration extends OntopOBDAConfiguration, OntopOptimizationConfiguration {

    @Override
    OntopReformulationSettings getSettings();

    /**
     * To call ONLY when interested by query REFORMULATION, not FULL query ANSWERING
     * (no query evaluation).
     */

    InputQueryFactory getInputQueryFactory();

    interface OntopReformulationBuilderFragment<B extends Builder<B>> {

        B enableExistentialReasoning(boolean enable);
    }

    interface Builder<B extends Builder<B>> extends OntopReformulationBuilderFragment<B>, OntopOBDAConfiguration.Builder<B>, OntopOptimizationConfiguration.Builder<B> {

        @Override
        OntopReformulationConfiguration build();
    }
}


package com.tencentcloudapi.live.v20180801.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeScreenShotSheetNumListRequest extends AbstractModel {

    /**
     * utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    @SerializedName("StartTime")
    @Expose
    private String StartTime;

    /**
     * utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    @SerializedName("EndTime")
    @Expose
    private String EndTime;

    /**
     * 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    @SerializedName("Zone")
    @Expose
    private String Zone;

    /**
     * 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    @SerializedName("PushDomains")
    @Expose
    private String[] PushDomains;

    /**
     * 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    @SerializedName("Granularity")
    @Expose
    private String Granularity;

    /**
     * Get utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @return StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */

{
        return this.StartTime;
    }

    /**
     * Set utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @param StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public void setStartTime(String StartTime) {
        this.StartTime = StartTime;
    }

    /**
     * Get utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @return EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public String getEndTime() {
        return this.EndTime;
    }

    /**
     * Set utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @param EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public void setEndTime(String EndTime) {
        this.EndTime = EndTime;
    }

    /**
     * Get 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @return Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public String getZone() {
        return this.Zone;
    }

    /**
     * Set 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @param Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public void setZone(String Zone) {
        this.Zone = Zone;
    }

    /**
     * Get 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @return PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public String[] getPushDomains() {
        return this.PushDomains;
    }

    /**
     * Set 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @param PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public void setPushDomains(String[] PushDomains) {
        this.PushDomains = PushDomains;
    }

    /**
     * Get 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @return Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public String getGranularity() {
        return this.Granularity;
    }

    /**
     * Set 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @param Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public void setGranularity(String Granularity) {
        this.Granularity = Granularity;
    }

    public DescribeScreenShotSheetNumListRequest() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeScreenShotSheetNumListRequest(DescribeScreenShotSheetNumListRequest source) {
        if (source.StartTime != null) {
            this.StartTime = new String(source.StartTime);
        }
        if (source.EndTime != null) {
            this.EndTime = new String(source.EndTime);
        }
        if (source.Zone != null) {
            this.Zone = new String(source.Zone);
        }
        if (source.PushDomains != null) {
            this.PushDomains = new String[source.PushDomains.length];
            for (int i = 0; i < source.PushDomains.length; i++) {
                this.PushDomains[i] = new String(source.PushDomains[i]);
            }
        }
        if (source.Granularity != null) {
            this.Granularity = new String(source.Granularity);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "StartTime", this.StartTime);
        this.setParamSimple(map, prefix + "EndTime", this.EndTime);
        this.setParamSimple(map, prefix + "Zone", this.Zone);
        this.setParamArraySimple(map, prefix + "PushDomains.", this.PushDomains);
        this.setParamSimple(map, prefix + "Granularity", this.Granularity);
    }
}


package com.tencentcloudapi.live.v20180801.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeScreenShotSheetNumListRequest extends AbstractModel {

    /**
     * utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    @SerializedName("StartTime")
    @Expose
    private String StartTime;

    /**
     * utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    @SerializedName("EndTime")
    @Expose
    private String EndTime;

    /**
     * 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    @SerializedName("Zone")
    @Expose
    private String Zone;

    /**
     * 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    @SerializedName("PushDomains")
    @Expose
    private String[] PushDomains;

    /**
     * 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    @SerializedName("Granularity")
    @Expose
    private String Granularity;

    /**
     * Get utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @return StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public String getStartTime() {
        return this.StartTime;
    }

    /**
     * Set utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @param StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public void setStartTime(String StartTime) {
        this.StartTime = StartTime;
    }

    /**
     * Get utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @return EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public String getEndTime() {
        return this.EndTime;
    }

    /**
     * Set utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @param EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public void setEndTime(String EndTime) {
        this.EndTime = EndTime;
    }

    /**
     * Get 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @return Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public String getZone()

    /**
     * Set 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @param Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public void setZone(String Zone) {
        this.Zone = Zone;
    }

    /**
     * Get 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @return PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public String[] getPushDomains() {
        return this.PushDomains;
    }

    /**
     * Set 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @param PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public void setPushDomains(String[] PushDomains) {
        this.PushDomains = PushDomains;
    }

    /**
     * Get 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @return Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public String getGranularity() {
        return this.Granularity;
    }

    /**
     * Set 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @param Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public void setGranularity(String Granularity) {
        this.Granularity = Granularity;
    }

    public DescribeScreenShotSheetNumListRequest() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeScreenShotSheetNumListRequest(DescribeScreenShotSheetNumListRequest source) {
        if (source.StartTime != null) {
            this.StartTime = new String(source.StartTime);
        }
        if (source.EndTime != null) {
            this.EndTime = new String(source.EndTime);
        }
        if (source.Zone != null) {
            this.Zone = new String(source.Zone);
        }
        if (source.PushDomains != null) {
            this.PushDomains = new String[source.PushDomains.length];
            for (int i = 0; i < source.PushDomains.length; i++) {
                this.PushDomains[i] = new String(source.PushDomains[i]);
            }
        }
        if (source.Granularity != null) {
            this.Granularity = new String(source.Granularity);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "StartTime", this.StartTime);
        this.setParamSimple(map, prefix + "EndTime", this.EndTime);
        this.setParamSimple(map, prefix + "Zone", this.Zone);
        this.setParamArraySimple(map, prefix + "PushDomains.", this.PushDomains);
        this.setParamSimple(map, prefix + "Granularity", this.Granularity);
    }
}


package com.tencentcloudapi.live.v20180801.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeScreenShotSheetNumListRequest extends AbstractModel {

    /**
     * utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    @SerializedName("StartTime")
    @Expose
    private String StartTime;

    /**
     * utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    @SerializedName("EndTime")
    @Expose
    private String EndTime;

    /**
     * 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    @SerializedName("Zone")
    @Expose
    private String Zone;

    /**
     * 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    @SerializedName("PushDomains")
    @Expose
    private String[] PushDomains;

    /**
     * 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    @SerializedName("Granularity")
    @Expose
    private String Granularity;

    /**
     * Get utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @return StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public String getStartTime() {
        return this.StartTime;
    }

    /**
     * Set utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @param StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public void setStartTime(String StartTime) {
        this.StartTime =

    }

    /**
     * Get utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @return EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public String getEndTime() {
        return this.EndTime;
    }

    /**
     * Set utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @param EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public void setEndTime(String EndTime) {
        this.EndTime = EndTime;
    }

    /**
     * Get 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @return Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public String getZone() {
        return this.Zone;
    }

    /**
     * Set 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @param Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public void setZone(String Zone) {
        this.Zone = Zone;
    }

    /**
     * Get 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @return PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public String[] getPushDomains() {
        return this.PushDomains;
    }

    /**
     * Set 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @param PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public void setPushDomains(String[] PushDomains) {
        this.PushDomains = PushDomains;
    }

    /**
     * Get 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @return Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public String getGranularity() {
        return this.Granularity;
    }

    /**
     * Set 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @param Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public void setGranularity(String Granularity) {
        this.Granularity = Granularity;
    }

    public DescribeScreenShotSheetNumListRequest() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeScreenShotSheetNumListRequest(DescribeScreenShotSheetNumListRequest source) {
        if (source.StartTime != null) {
            this.StartTime = new String(source.StartTime);
        }
        if (source.EndTime != null) {
            this.EndTime = new String(source.EndTime);
        }
        if (source.Zone != null) {
            this.Zone = new String(source.Zone);
        }
        if (source.PushDomains != null) {
            this.PushDomains = new String[source.PushDomains.length];
            for (int i = 0; i < source.PushDomains.length; i++) {
                this.PushDomains[i] = new String(source.PushDomains[i]);
            }
        }
        if (source.Granularity != null) {
            this.Granularity = new String(source.Granularity);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "StartTime", this.StartTime);
        this.setParamSimple(map, prefix + "EndTime", this.EndTime);
        this.setParamSimple(map, prefix + "Zone", this.Zone);
        this.setParamArraySimple(map, prefix + "PushDomains.", this.PushDomains);
        this.setParamSimple(map, prefix + "Granularity", this.Granularity);
    }
}


public void setStartTime(String StartTime) {
        this.StartTime = StartTime;
    }

package com.tencentcloudapi.live.v20180801.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeScreenShotSheetNumListRequest extends AbstractModel {

    /**
     * utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    @SerializedName("StartTime")
    @Expose
    private String StartTime;

    /**
     * utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    @SerializedName("EndTime")
    @Expose
    private String EndTime;

    /**
     * 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    @SerializedName("Zone")
    @Expose
    private String Zone;

    /**
     * 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    @SerializedName("PushDomains")
    @Expose
    private String[] PushDomains;

    /**
     * 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    @SerializedName("Granularity")
    @Expose
    private String Granularity;

    /**
     * Get utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @return StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public String getStartTime() {
        return this.StartTime;
    }

    /**
     * Set utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @param StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */

    /**
     * Get utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @return EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public String getEndTime() {
        return this.EndTime;
    }

    /**
     * Set utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @param EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public void setEndTime(String EndTime) {
        this.EndTime = EndTime;
    }

    /**
     * Get 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @return Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public String getZone() {
        return this.Zone;
    }

    /**
     * Set 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @param Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public void setZone(String Zone) {
        this.Zone = Zone;
    }

    /**
     * Get 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @return PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public String[] getPushDomains() {
        return this.PushDomains;
    }

    /**
     * Set 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @param PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public void setPushDomains(String[] PushDomains) {
        this.PushDomains = PushDomains;
    }

    /**
     * Get 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @return Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public String getGranularity() {
        return this.Granularity;
    }

    /**
     * Set 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @param Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public void setGranularity(String Granularity) {
        this.Granularity = Granularity;
    }

    public DescribeScreenShotSheetNumListRequest() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeScreenShotSheetNumListRequest(DescribeScreenShotSheetNumListRequest source) {
        if (source.StartTime != null) {
            this.StartTime = new String(source.StartTime);
        }
        if (source.EndTime != null) {
            this.EndTime = new String(source.EndTime);
        }
        if (source.Zone != null) {
            this.Zone = new String(source.Zone);
        }
        if (source.PushDomains != null) {
            this.PushDomains = new String[source.PushDomains.length];
            for (int i = 0; i < source.PushDomains.length; i++) {
                this.PushDomains[i] = new String(source.PushDomains[i]);
            }
        }
        if (source.Granularity != null) {
            this.Granularity = new String(source.Granularity);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "StartTime", this.StartTime);
        this.setParamSimple(map, prefix + "EndTime", this.EndTime);
        this.setParamSimple(map, prefix + "Zone", this.Zone);
        this.setParamArraySimple(map, prefix + "PushDomains.", this.PushDomains);
        this.setParamSimple(map, prefix + "Granularity", this.Granularity);
    }
}


for (int i = 0; i < source.PushDomains.length; i++) {
                this.PushDomains[i] = new String(source.PushDomains[i]);
            }

package com.tencentcloudapi.live.v20180801.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeScreenShotSheetNumListRequest extends AbstractModel {

    /**
     * utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    @SerializedName("StartTime")
    @Expose
    private String StartTime;

    /**
     * utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    @SerializedName("EndTime")
    @Expose
    private String EndTime;

    /**
     * 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    @SerializedName("Zone")
    @Expose
    private String Zone;

    /**
     * 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    @SerializedName("PushDomains")
    @Expose
    private String[] PushDomains;

    /**
     * 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    @SerializedName("Granularity")
    @Expose
    private String Granularity;

    /**
     * Get utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @return StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public String getStartTime() {
        return this.StartTime;
    }

    /**
     * Set utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     * @param StartTime utc起始时间，格式为yyyy-mm-ddTHH:MM:SSZ
     */
    public void setStartTime(String StartTime) {
        this.StartTime = StartTime;
    }

    /**
     * Get utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @return EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public String getEndTime() {
        return this.EndTime;
    }

    /**
     * Set utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     * @param EndTime utc结束时间，格式为yyyy-mm-ddTHH:MM:SSZ，支持查询最近1年数据。
     */
    public void setEndTime(String EndTime) {
        this.EndTime = EndTime;
    }

    /**
     * Get 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @return Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public String getZone() {
        return this.Zone;
    }

    /**
     * Set 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     * @param Zone 地域信息，可选值包括Mainland，Oversea，前者是查询中国大陆范围内的数据，后者是除中国大陆范围之外的数据，若不传该参数，则查询所有地区的数据。
     */
    public void setZone(String Zone) {
        this.Zone = Zone;
    }

    /**
     * Get 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @return PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public String[] getPushDomains() {
        return this.PushDomains;
    }

    /**
     * Set 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     * @param PushDomains 推流域名（支持查询2019年11 月1日之后的域名维度数据）。
     */
    public void setPushDomains(String[] PushDomains) {
        this.PushDomains = PushDomains;
    }

    /**
     * Get 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @return Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public String getGranularity() {
        return this.Granularity;
    }

    /**
     * Set 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     * @param Granularity 数据维度，数据延迟1个半小时，可选值包括：1、Minute（5分钟粒度，最大支持查询时间范围是31天），2、Day（天粒度，默认值，按照北京时间做跨天处理，最大支持查询时间范围是186天当天）。
     */
    public void setGranularity(String Granularity) {
        this.Granularity = Granularity;
    }

    public DescribeScreenShotSheetNumListRequest() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeScreenShotSheetNumListRequest(DescribeScreenShotSheetNumListRequest source) {
        if (source.StartTime != null) {
            this.StartTime = new String(source.StartTime);
        }
        if (source.EndTime != null) {
            this.EndTime = new String(source.EndTime);
        }
        if (source.Zone != null) {
            this.Zone = new String(source.Zone);
        }
        if (source.PushDomains != null) {
            this.PushDomains = new String[source.PushDomains.length];

        }
        if (source.Granularity != null) {
            this.Granularity = new String(source.Granularity);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "StartTime", this.StartTime);
        this.setParamSimple(map, prefix + "EndTime", this.EndTime);
        this.setParamSimple(map, prefix + "Zone", this.Zone);
        this.setParamArraySimple(map, prefix + "PushDomains.", this.PushDomains);
        this.setParamSimple(map, prefix + "Granularity", this.Granularity);
    }
}


package com.rs2.event;

/**
 * Represents the context of an {@link Event}
 *
 * @author Ryley Kimmel <example@nnthink.com>
 */
public interface EventContext {

    /**
     * Breaks the chain of subscribers.
     */

    /**
     * Repairs the chain of subscribers.
     */
    void repairSubscriberChain();

    /**
     * Checks whether or not the subscriber chain is broken.
     *
     * @return {@code true} if and only if the chain is broken, otherwise
     *         {@code false}.
     */
    boolean isChainBroken();
}


@Override
            public void run(SourceContext<Long> sourceContext) throws Exception

package com.zhisheng.examples.streaming.restartStrategy;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.restartstrategy.RestartStrategies;
import org.apache.flink.api.java.utils.ParameterTool;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.SourceFunction;

/**
 * Desc: 测试重启代码出现异常，导致触发重启策略
 * Created by zhisheng on 2019-04-19
 * blog：http://example.com
 * 微信公众号：zhisheng
 */
public class AEMain {

    public static void main(String[] args) throws Exception {
        // 创建流运行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.getConfig().setGlobalJobParameters(ParameterTool.fromArgs(args));
        // 每隔 5s 重启一次，尝试三次如果 Job 还没有起来则停止
        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 5000));
        env.addSource(new SourceFunction<Long>() {

{
                while (true) {
                    sourceContext.collect(System.currentTimeMillis());
                }
            }

            @Override
            public void cancel() {
            }
        }).map((MapFunction<Long, Long>) aLong -> aLong / 0).print();
        env.execute("zhisheng RestartStrategy example");
    }
}


{
                while (true) {
                    sourceContext.collect(System.currentTimeMillis());
                }
            }

package com.zhisheng.examples.streaming.restartStrategy;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.restartstrategy.RestartStrategies;
import org.apache.flink.api.java.utils.ParameterTool;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.SourceFunction;

/**
 * Desc: 测试重启代码出现异常，导致触发重启策略
 * Created by zhisheng on 2019-04-19
 * blog：http://example.com
 * 微信公众号：zhisheng
 */
public class AEMain {

    public static void main(String[] args) throws Exception {
        // 创建流运行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.getConfig().setGlobalJobParameters(ParameterTool.fromArgs(args));
        // 每隔 5s 重启一次，尝试三次如果 Job 还没有起来则停止
        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 5000));
        env.addSource(new SourceFunction<Long>() {

            @Override
            public void run(SourceContext<Long> sourceContext) throws Exception

            @Override
            public void cancel() {
            }
        }).map((MapFunction<Long, Long>) aLong -> aLong / 0).print();
        env.execute("zhisheng RestartStrategy example");
    }
}


package com.zhisheng.examples.streaming.restartStrategy;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.restartstrategy.RestartStrategies;
import org.apache.flink.api.java.utils.ParameterTool;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.SourceFunction;

/**
 * Desc: 测试重启代码出现异常，导致触发重启策略
 * Created by zhisheng on 2019-04-19
 * blog：http://example.com
 * 微信公众号：zhisheng
 */
public class AEMain {

    public static void main(String[] args) throws Exception {
        // 创建流运行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment

        env.getConfig().setGlobalJobParameters(ParameterTool.fromArgs(args));
        // 每隔 5s 重启一次，尝试三次如果 Job 还没有起来则停止
        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 5000));
        env.addSource(new SourceFunction<Long>() {

            @Override
            public void run(SourceContext<Long> sourceContext) throws Exception {
                while (true) {
                    sourceContext.collect(System.currentTimeMillis());
                }
            }

            @Override
            public void cancel() {
            }
        }).map((MapFunction<Long, Long>) aLong -> aLong / 0).print();
        env.execute("zhisheng RestartStrategy example");
    }
}


while (true) {
                    sourceContext.collect(System.currentTimeMillis());
                }

package com.zhisheng.examples.streaming.restartStrategy;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.restartstrategy.RestartStrategies;
import org.apache.flink.api.java.utils.ParameterTool;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.SourceFunction;

/**
 * Desc: 测试重启代码出现异常，导致触发重启策略
 * Created by zhisheng on 2019-04-19
 * blog：http://example.com
 * 微信公众号：zhisheng
 */
public class AEMain {

    public static void main(String[] args) throws Exception {
        // 创建流运行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.getConfig().setGlobalJobParameters(ParameterTool.fromArgs(args));
        // 每隔 5s 重启一次，尝试三次如果 Job 还没有起来则停止
        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 5000));
        env.addSource(new SourceFunction<Long>() {

            @Override
            public void run(SourceContext<Long> sourceContext) throws Exception {

            }

            @Override
            public void cancel() {
            }
        }).map((MapFunction<Long, Long>) aLong -> aLong / 0).print();
        env.execute("zhisheng RestartStrategy example");
    }
}


package org.locationtech.udig.catalog.jgrass.activeregion.dialogs;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.Vector;
import org.locationtech.udig.catalog.CatalogPlugin;
import org.locationtech.udig.catalog.ICatalog;
import org.locationtech.udig.catalog.IResolve;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.locationtech.udig.catalog.jgrass.JGrassPlugin;
import org.locationtech.udig.catalog.jgrass.core.JGrassMapGeoResource;
import org.locationtech.udig.catalog.jgrass.core.JGrassMapsetGeoResource;
import org.locationtech.udig.catalog.jgrass.core.JGrassService;

/**
 * <p>
 * This class supplies a tree viewer containing the JGrass mapsets that are in the catalog When a
 * mapset is selected it is passed to the WidgetObservers that are registered with this class.
 * </p>
 *
 * @author Andrea Antonello - www.hydrologis.com
 * @since 1.1.0
 */
public class CatalogJGrassMapsetsTreeViewer extends Composite implements ISelectionChangedListener, IResourcesSelector {

    private final HashMap<String, JGrassMapsetGeoResource> itemsMap = new HashMap<String, JGrassMapsetGeoResource>();

    private LabelProvider labelProvider = null;

    private List<JGrassMapsetGeoResource> itemLayers;

    /**
     * @param parent
     * @param style
     * @param selectionStyle the tree selection style (single or multiple)
     * @param mapType the types of map to be filtered out (ex.
     *        {@link FeatureLayerTreeViewer.SHAPELAYER})
     */
    public CatalogJGrassMapsetsTreeViewer(Composite parent, int style, int selectionStyle) {
        super(parent, style);
        setLayout(new GridLayout(1, false));
        GridData gridData = new GridData();
        gridData.grabExcessHorizontalSpace = true;
        gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
        gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
        gridData.grabExcessVerticalSpace = true;
        setLayoutData(gridData);
        // Create the tree viewer to display the file tree
        PatternFilter patternFilter = new PatternFilter();
        final FilteredTree filter = new FilteredTree(this, selectionStyle, patternFilter);
        final TreeViewer tv = filter.getViewer();
        tv.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
        tv.setContentProvider(new ContentProvider());
        labelProvider = new LabelProvider();
        tv.setLabelProvider(labelProvider);
        // pass a non-null that will be ignored //$NON-NLS-1$
        tv.setInput("dummy");
        tv.addSelectionChangedListener(this);
    }

    public void selectionChanged(SelectionChangedEvent event) {
        // if the selection is empty clear the label
        if (event.getSelection().isEmpty()) {
            return;
        }
        if (event.getSelection() instanceof IStructuredSelection) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            Vector<String> itemNames = new Vector<String>();
            for (Iterator iterator = selection.iterator(); iterator.hasNext(); ) {
                Object domain = iterator.next();
                String value = labelProvider.getText(domain);
                itemNames.add(value);
            }
            itemLayers = new ArrayList<JGrassMapsetGeoResource>();
            for (String name : itemNames) {
                JGrassMapsetGeoResource tmpLayer = itemsMap.get(name);
                if (tmpLayer != null) {
                    itemLayers.add(tmpLayer);
                }
            }
        }
    }

    /**
     * This class provides the content for the tree in FileTree
     */
    private class ContentProvider implements ITreeContentProvider {

        /**
         * Gets the children of the specified object
         *
         * @param arg0 the parent object
         * @return Object[]
         */
        public Object[] getChildren(Object arg0) {
            if (arg0 instanceof JGrassService) {
                JGrassService map = (JGrassService) arg0;
                List<IResolve> layers = null;
                try {
                    layers = map.members(null);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (layers == null)
                    return null;
                return filteredLayers(layers);
            } else if (arg0 instanceof JGrassMapsetGeoResource) {
                return null;
            }
            return null;
        }

        private Object[] filteredLayers(List<IResolve> layers) {
            Vector<JGrassMapsetGeoResource> filteredLayers = new Vector<JGrassMapsetGeoResource>();
            for (IResolve layer : layers) {
                if (layer instanceof JGrassMapsetGeoResource) {
                    filteredLayers.add((JGrassMapsetGeoResource) layer);
                    itemsMap.put(((JGrassMapsetGeoResource) layer).getTitle(), (JGrassMapsetGeoResource) layer);
                }
            }
            /*
             * now let's sort them for nice visualization
             */
            HashMap<String, JGrassMapsetGeoResource> tmp = new HashMap<String, JGrassMapsetGeoResource>();
            for (JGrassMapsetGeoResource resource : filteredLayers) {
                tmp.put(resource.getTitle(), resource);
            }
            Map<String, JGrassMapsetGeoResource> sortedMap = new TreeMap<String, JGrassMapsetGeoResource>(tmp);
            filteredLayers.removeAllElements();
            for (JGrassMapsetGeoResource map : sortedMap.values()) {
                filteredLayers.add(map);
            }
            return filteredLayers.toArray();
        }

        /**
         * Gets the parent of the specified object
         *
         * @param arg0 the object
         * @return Object
         */
        public Object getParent(Object arg0) {
            if (arg0 instanceof JGrassMapsetGeoResource) {
                return null;
            } else if (arg0 instanceof JGrassMapGeoResource) {
                try {
                    return ((JGrassMapGeoResource) arg0).parent(null);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return null;
        }

        /**
         * Returns whether the passed object has children
         *
         * @param arg0 the parent object
         * @return boolean
         */
        public boolean hasChildren(Object arg0) {
            if (arg0 instanceof JGrassService) {
                return true;
            } else if (arg0 instanceof JGrassMapsetGeoResource) {
                return false;
            }
            return false;
        }

        /**
         * Gets the root element(s) of the tree
         *
         * @param arg0 the input data
         * @return Object[]
         */
        public Object[] getElements(Object arg0) {
            // add the service to the catalog
            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
            try {
                ArrayList<IResolve> finalCatalogMembers = new ArrayList<IResolve>();
                List<? extends IResolve> allCatalogMembers = catalog.members(null);
                for (IResolve resolve : allCatalogMembers) {
                    if (resolve instanceof JGrassService) {
                        finalCatalogMembers.add(resolve);
                    }
                }
                if (finalCatalogMembers.size() > 0) {
                    return finalCatalogMembers.toArray();
                } else {
                    return null;
                }
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        /**
         * Disposes any created resources
         */
        public void dispose() {
            // Nothing to dispose
        }

        /**
         * Called when the input changes
         *
         * @param arg0 the viewer
         * @param arg1 the old input
         * @param arg2 the new input
         */
        public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
            // Nothing to change
        }
    }

    /**
     * This class provides the labels for the file tree
     */
    private static class LabelProvider implements ILabelProvider {

        // The listeners
        private final List<ILabelProviderListener> listeners;

        // Images for tree nodes
        private final Image rasterMaps;

        private final Image mainRasterMaps;

        // Label provider state: preserve case of file names/directories
        /**
         * Constructs a FileTreeLabelProvider
         */
        public LabelProvider() {
            // Create the list to hold the listeners
            listeners = new ArrayList<ILabelProviderListener>();
            // Create the images
            mainRasterMaps = AbstractUIPlugin.imageDescriptorFromPlugin(JGrassPlugin.PLUGIN_ID, "icons/obj16/jgrassloc_obj.gif").createImage();
            rasterMaps = AbstractUIPlugin.imageDescriptorFromPlugin(JGrassPlugin.PLUGIN_ID, "icons/obj16/jgrass_obj.gif").createImage();
        }

        // * Sets the preserve case attribute
        // * @param preserveCase the preserve case attribute
        // // Since this attribute affects how the labels are computed,
        // // notify all the listeners of the change.
        /**
         * Gets the image to display for a node in the tree
         *
         * @param arg0 the node
         * @return Image
         */

{
            if (arg0 instanceof JGrassService) {
                return mainRasterMaps;
            } else if (arg0 instanceof JGrassMapsetGeoResource) {
                return rasterMaps;
            } else {
                return null;
            }
        }

        /**
         * Gets the text to display for a node in the tree
         *
         * @param arg0 the node
         * @return String
         */
        public String getText(Object arg0) {
            String text = null;
            try {
                if (arg0 instanceof JGrassMapsetGeoResource) {
                    text = ((JGrassMapsetGeoResource) arg0).getTitle();
                } else if (arg0 instanceof JGrassService) {
                    text = ((JGrassService) arg0).getInfo(null).getTitle();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return text;
        }

        /**
         * Adds a listener to this label provider
         *
         * @param arg0 the listener
         */
        public void addListener(ILabelProviderListener arg0) {
            listeners.add(arg0);
        }

        /**
         * Called when this LabelProvider is being disposed
         */
        public void dispose() {
            // Dispose the images
            if (rasterMaps != null)
                rasterMaps.dispose();
        }

        /**
         * Returns whether changes to the specified property on the specified element would affect
         * the label for the element
         *
         * @param arg0 the element
         * @param arg1 the property
         * @return boolean
         */
        public boolean isLabelProperty(Object arg0, String arg1) {
            return false;
        }

        /**
         * Removes the listener
         *
         * @param arg0 the listener to remove
         */
        public void removeListener(ILabelProviderListener arg0) {
            listeners.remove(arg0);
        }
    }

    public List<JGrassMapsetGeoResource> getSelectedLayers() {
        return itemLayers;
    }

    public int getType() {
        return 0;
    }
}