Package com.clarkparsia.pellet.datatypes

Examples of com.clarkparsia.pellet.datatypes.OWLRealInterval$IntegerIterator


   * other's lower and the (in|ex)clusiveness differs), then they do not
   * intersect.
   */
  @Test
  public void intersectionMeetsCon() {
    final OWLRealInterval a = interval( null, 2.1, false, false, LineType.CONTINUOUS );
    final OWLRealInterval b = interval( 2.1, null, true, false, LineType.CONTINUOUS );

    assertNull( a.intersection( b ) );
    assertNull( b.intersection( a ) );

    assertEquals( IntervalRelations.MEETS, a.compare( b ) );
    assertEquals( IntervalRelations.MET_BY, b.compare( a ) );
  }
View Full Code Here


   * other's lower and the (in|ex)clusiveness differs), then they do not
   * intersect.
   */
  @Test
  public void intersectionMeetsNoI() {
    final OWLRealInterval a = interval( null, 2.1, false, false, LineType.INTEGER_EXCLUDED );
    final OWLRealInterval b = interval( 2.1, null, true, false, LineType.INTEGER_EXCLUDED );

    assertNull( a.intersection( b ) );
    assertNull( b.intersection( a ) );

    assertEquals( IntervalRelations.MEETS, a.compare( b ) );
    assertEquals( IntervalRelations.MET_BY, b.compare( a ) );
  }
View Full Code Here

   * Verify that the overlap of two continuous intervals with exclusive bounds
   * intersect correctly.
   */
  @Test
  public void intersectionOverlapConCon1() {
    final OWLRealInterval a = interval( null, 0.51, false, false, LineType.CONTINUOUS );
    final OWLRealInterval b = interval( 0.49, null, false, false, LineType.CONTINUOUS );

    final OWLRealInterval expected = interval( 0.49, 0.51, false, false, LineType.CONTINUOUS );
    assertEquals( expected, a.intersection( b ) );
    assertEquals( expected, b.intersection( a ) );

    assertTrue( a.intersection( b ).contains( BigDecimal.valueOf( 0.50 ) ) );
    assertTrue( b.intersection( a ).contains( BigDecimal.valueOf( 0.50 ) ) );
View Full Code Here

   * Verify that the overlap of two continuous intervals with inclusive bounds
   * intersect correctly.
   */
  @Test
  public void intersectionOverlapConCon2() {
    final OWLRealInterval a = interval( null, 0.51, false, true, LineType.CONTINUOUS );
    final OWLRealInterval b = interval( 0.49, null, true, false, LineType.CONTINUOUS );

    final OWLRealInterval expected = interval( 0.49, 0.51, true, true, LineType.CONTINUOUS );
    assertEquals( expected, a.intersection( b ) );
    assertEquals( expected, b.intersection( a ) );

    assertTrue( a.intersection( b ).contains( BigDecimal.valueOf( 0.50 ) ) );
    assertTrue( b.intersection( a ).contains( BigDecimal.valueOf( 0.50 ) ) );
View Full Code Here

   * Verify that two continuous intervals overlapping just on an inclusive
   * bound intersect to a point.
   */
  @Test
  public void intersectionPointCon() {
    final OWLRealInterval a = interval( null, 2.1, false, true, LineType.CONTINUOUS );
    final OWLRealInterval b = interval( 2.1, null, true, false, LineType.CONTINUOUS );

    final OWLRealInterval expected = new OWLRealInterval( BigDecimal.valueOf( 2.1d ) );

    assertEquals( expected, a.intersection( b ) );
    assertEquals( expected, b.intersection( a ) );

    assertTrue( a.intersection( b ).isPoint() );
View Full Code Here

   * Verify that two integer intervals overlapping just on an inclusive bound
   * intersect to a point.
   */
  @Test
  public void intersectionPointOnly() {
    final OWLRealInterval a = interval( null, 2, false, true, LineType.INTEGER_ONLY );
    final OWLRealInterval b = interval( 2, null, true, false, LineType.INTEGER_ONLY );

    final OWLRealInterval expected = new OWLRealInterval( Integer.valueOf( 2 ) );

    assertEquals( expected, a.intersection( b ) );
    assertEquals( expected, b.intersection( a ) );

    assertTrue( a.intersection( b ).isPoint() );
View Full Code Here

   * interval which it starts and which share an inclusive endpoint is
   * correct.
   */
  @Test
  public void intersectionStartsConCon1() {
    final OWLRealInterval a = interval( 2.1, 3.1, true, true, LineType.CONTINUOUS );
    final OWLRealInterval b = interval( 2.1, null, true, false, LineType.CONTINUOUS );

    assertEquals( a, a.intersection( b ) );
    assertEquals( a, b.intersection( a ) );

    assertEquals( IntervalRelations.STARTS, a.compare( b ) );
    assertEquals( IntervalRelations.STARTED_BY, b.compare( a ) );
  }
View Full Code Here

   * interval which it starts and which share an exclusive endpoint is
   * correct.
   */
  @Test
  public void intersectionStartsConCon2() {
    final OWLRealInterval a = interval( 2.1, 3.1, false, true, LineType.CONTINUOUS );
    final OWLRealInterval b = interval( 2.1, null, false, false, LineType.CONTINUOUS );

    assertEquals( a, a.intersection( b ) );
    assertEquals( a, b.intersection( a ) );

    assertEquals( IntervalRelations.STARTS, a.compare( b ) );
    assertEquals( IntervalRelations.STARTED_BY, b.compare( a ) );
  }
View Full Code Here

   * interval which it starts but for which the endpoint type is different it
   * correct (i.e., it isn't a start relation).
   */
  @Test
  public void intersectionStartsConCon3() {
    final OWLRealInterval a = interval( 2.1, 3.1, false, true, LineType.CONTINUOUS );
    final OWLRealInterval b = interval( 2.1, null, true, false, LineType.CONTINUOUS );

    assertEquals( a, a.intersection( b ) );
    assertEquals( a, b.intersection( a ) );

    assertEquals( IntervalRelations.DURING, a.compare( b ) );
    assertEquals( IntervalRelations.CONTAINS, b.compare( a ) );
  }
View Full Code Here

  /**
   * Verify that a continuous interval with unequal bounds is not a point.
   */
  @Test
  public void isPointFalseCon() {
    final OWLRealInterval a = interval( 0.1, 0.2, true, true, LineType.CONTINUOUS );

    assertFalse( a.isPoint() );
  }
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.datatypes.OWLRealInterval$IntegerIterator

Copyright © 2018 www.massapicom. 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.