Class PartialFunction

  • All Implemented Interfaces:
    OrderedPairs

    public class PartialFunction
    extends Object
    implements OrderedPairs
    A partial function from X to Y is a function f: X' → Y, where X' is a subset of X. It generalizes the concept of a function by not forcing f to map every element of X to an element of Y (only some subset X' of X).

    A partial function is a special type of binary relation, which does not allow duplicated abscissae in its collection of ordered pairs.

    This class is immutable.

    • Constructor Detail

      • PartialFunction

        public PartialFunction​(double[] x,
                               double[] y)
        Construct a partial function from {(x,y)}.
        Parameters:
        x - elements in A
        y - elements in A
    • Method Detail

      • x

        public double[] x()
        Description copied from interface: OrderedPairs
        Get the abscissae.
        Specified by:
        x in interface OrderedPairs
        Returns:
        the abscissae
      • y

        public double[] y()
        Description copied from interface: OrderedPairs
        Get the ordinates.
        Specified by:
        y in interface OrderedPairs
        Returns:
        the ordinates
      • size

        public int size()
        Description copied from interface: OrderedPairs
        Get the number of points.
        Specified by:
        size in interface OrderedPairs
        Returns:
        the number of points