Interval
edu.jas.root

Class Interval<C extends RingElem<C> & Rational>

    • Constructor Detail

      • Interval

        public Interval(C left,        C right)
        Constructor.
        Parameters:
        left - interval border.
        right - interval border.
      • Interval

        public Interval(C mid)
        Constructor.
        Parameters:
        mid - left and right interval border.
    • Method Detail

      • toScript

        public String toScript()
        Get a scripting compatible string representation.
        Returns:
        script compatible representation for this Interval.
      • copy

        public Interval<C> copy()
        Copy this.
        Returns:
        a copy of this.
      • contains

        public boolean contains(C c)
        Test if an element is contained in this interval.
        Parameters:
        c - element to test.
        Returns:
        true, if left <= b <= right;
      • contains

        public boolean contains(Interval<C> vc)
        Test if an interval is contained in this interval.
        Parameters:
        vc - interval to test.
        Returns:
        true, if left <= vc.left and vc.right <= right;
      • length

        public C length()
        Length.
        Returns:
        |left-right|;
      • rationalLength

        public BigRational rationalLength()
        BigRational Length.
        Returns:
        |left-right|;
      • toDecimal

        public BigDecimal toDecimal()
        BigDecimal representation of Interval.
      • rationalMiddle

        public BigRational rationalMiddle()
        Rational middle point.
        Returns:
        (left+right)/2;
      • middle

        public C middle()
        Middle point.
        Returns:
        (left+right)/2;
      • randomPoint

        public C randomPoint()
        Random point of interval.
        Returns:
        a random point contained in this interval.

SCaVis 2.2 © jWork.ORG