Package com.clarkparsia.pellet.datatypes.types.real

Examples of com.clarkparsia.pellet.datatypes.types.real.RestrictedRealDatatype.exclude()


  @Test
  public void excludeConInt1() {
    RestrictedDatatype<Number> dr = new RestrictedRealDatatype( dt, IntegerInterval
        .allIntegers(), ContinuousRealInterval.allReals(), ContinuousRealInterval
        .allReals() );
    dr = dr.exclude( singleton( 1 ) );

    assertFalse( dr.contains( 1 ) );
    assertTrue( dr.contains( 0 ) );
    assertTrue( dr.contains( 2 ) );
    assertTrue( dr.contains( decimal( "0.99999" ) ) );
View Full Code Here


  @Test
  public void excludeConInt2() {
    RestrictedDatatype<Number> dr = new RestrictedRealDatatype( dt, IntegerInterval
        .allIntegers(), ContinuousRealInterval.allReals(), ContinuousRealInterval
        .allReals() );
    dr = dr.exclude( Arrays.asList( 1, 2, 3 ) );

    assertFalse( dr.contains( 1 ) );
    assertFalse( dr.contains( 2 ) );
    assertFalse( dr.contains( 3 ) );
    assertTrue( dr.contains( 0 ) );
View Full Code Here

  @Test
  public void excludeConNoI1() {
    RestrictedDatatype<Number> dr = new RestrictedRealDatatype( dt, IntegerInterval
        .allIntegers(), ContinuousRealInterval.allReals(), ContinuousRealInterval
        .allReals() );
    dr = dr.exclude( singleton( decimal( "1.1" ) ) );

    assertFalse( dr.contains( decimal( "1.1" ) ) );
    assertTrue( dr.contains( 1 ) );
    assertTrue( dr.contains( 2 ) );
    assertTrue( dr.contains( decimal( "1.09999" ) ) );
View Full Code Here

  @Test
  public void excludeConNoI2() {
    RestrictedDatatype<Number> dr = new RestrictedRealDatatype( dt, IntegerInterval
        .allIntegers(), ContinuousRealInterval.allReals(), ContinuousRealInterval
        .allReals() );
    dr = dr.exclude( Arrays.asList( decimal( "1.1" ), decimal( "2.2" ), decimal( "3.3" ) ) );

    assertFalse( dr.contains( decimal( "1.1" ) ) );
    assertFalse( dr.contains( decimal( "2.2" ) ) );
    assertFalse( dr.contains( decimal( "3.3" ) ) );
    assertTrue( dr.contains( 2 ) );
View Full Code Here

   */
  @Test
  public void excludeIntInt1() {
    RestrictedDatatype<Number> dr = new RestrictedRealDatatype( dt, IntegerInterval
        .allIntegers(), null, null );
    dr = dr.exclude( singleton( 1 ) );

    assertFalse( dr.contains( 1 ) );
    assertTrue( dr.contains( 0 ) );
    assertTrue( dr.contains( 2 ) );
    assertFalse( dr.contains( decimal( "0.99999" ) ) );
View Full Code Here

   */
  @Test
  public void excludeIntInt2() {
    RestrictedDatatype<Number> dr = new RestrictedRealDatatype( dt, IntegerInterval
        .allIntegers(), null, null );
    dr = dr.exclude( Arrays.asList( 1, 2, 3 ) );

    assertFalse( dr.contains( 1 ) );
    assertFalse( dr.contains( 2 ) );
    assertFalse( dr.contains( 3 ) );
    assertTrue( dr.contains( 0 ) );
View Full Code Here

  public void excludeIrrelevant1() {
    final String value = "A String, not a Number";
    RestrictedDatatype<Number> dr = new RestrictedRealDatatype( dt, IntegerInterval
        .allIntegers(), ContinuousRealInterval.allReals(), ContinuousRealInterval
        .allReals() );
    dr = dr.exclude( singleton( value ) );

    assertFalse( dr.contains( value ) );
    assertFalse( dr.isEmpty() );
    assertFalse( dr.isEnumerable() );
    assertFalse( dr.isFinite() );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.