Documentation of 'org.jquantlib.util.Std' Java class
Std
org.jquantlib.util

Class Std



  • public class Std
    extends java.lang.Object
    This class contains utility methods similar to C++ std functions
    • Constructor Summary

      Constructors 
      Constructor and Description
      Std() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static <T> int copy(java.util.List<T> from, int first, int last, java.util.List<T> to)
      std:copy: Copy range of elements Copies the elements in the range [first,last) into a range beginning at result.
      static <T> int copy(java.util.List<T> from, int first, int last, java.util.List<T> to, int toFrom) 
      static <T> int distance(java.util.List<T> values, int first, int last)
      This method is equivalent to C++ std:distance function Return distance between indices (or iterators) Calculates the number of elements between first and last.
      static <T> boolean equal(java.util.List<T> first, int from, int last, java.util.List<T> second, int secondFrom)
      Test whether the elements in two ranges are equal Compares the elements in the range [first1,last1) with those in the range beginning at first2, and returns true if the elements in both ranges are considered equal.
      static <T> boolean equal(java.util.List<T> first, java.util.List<T> second) 
      static <T> void fill(java.util.List<T> array, int from, int last, T value) 
      static <T> int lowerBound(java.util.List<T> valueList, java.lang.Comparable<T> value) 
      static <T> int lowerBound(java.util.List<T> valueList, int fromIdx, int toIdx, java.lang.Comparable<T> value)
      This method is equivalent to std:lower_bound function Returns an index pointing to the first element in the ordered collection is equal or greater than passed value
      static <T extends java.lang.Number>
      int
      transform(java.util.List<T> list1, int first1, int last1, java.util.List<T> list2, int first2, java.util.List<T> result, Std.BinaryOperator<T> binaryOp) 
      static <T> int upperBound(java.util.List<T> valueList, java.lang.Comparable<T> value) 
      static <T> int upperBound(java.util.List<T> valueList, int fromIdx, int toIdx, java.lang.Comparable<T> value)
      This method is equivalent to C++ std:upper_bound function Returns an index pointing to the first element in the ordered collection which is greater than passed value
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Std

        public Std()
    • Method Detail

      • lowerBound

        public static <T> int lowerBound(java.util.List<T> valueList,
                                         int fromIdx,
                                         int toIdx,
                                         java.lang.Comparable<T> value)
        This method is equivalent to std:lower_bound function Returns an index pointing to the first element in the ordered collection is equal or greater than passed value
        Parameters:
        valueList - order collection in ascending order
        value - Date to be compared
        Returns:
        index to element which is >= passed value
      • lowerBound

        public static <T> int lowerBound(java.util.List<T> valueList,
                                         java.lang.Comparable<T> value)
      • upperBound

        public static <T> int upperBound(java.util.List<T> valueList,
                                         int fromIdx,
                                         int toIdx,
                                         java.lang.Comparable<T> value)
        This method is equivalent to C++ std:upper_bound function Returns an index pointing to the first element in the ordered collection which is greater than passed value
        Type Parameters:
        T -
        Parameters:
        valueList - order collection in ascending order
        value - Date to be compared
        Returns:
        index to element which is > passed value
      • upperBound

        public static <T> int upperBound(java.util.List<T> valueList,
                                         java.lang.Comparable<T> value)
      • distance

        public static <T> int distance(java.util.List<T> values,
                                       int first,
                                       int last)
        This method is equivalent to C++ std:distance function Return distance between indices (or iterators) Calculates the number of elements between first and last. If i is a Random Access Iterator, the function uses operator- to calculate this. Otherwise, the function uses repeatedly the increase or decrease operator (operator++ or operator--) until this distance is calculated.
      • copy

        public static <T> int copy(java.util.List<T> from,
                                   int first,
                                   int last,
                                   java.util.List<T> to)
        std:copy: Copy range of elements Copies the elements in the range [first,last) into a range beginning at result. Returns an iterator to the last element in the destination range Parameters first, last Input iterators to the initial and final positions in a sequence to be copied. The range used is [first,last), which contains all the elements between first and last, including the element pointed by first but not the element pointed by last. result Output iterator to the initial position in the destination sequence. This shall not point to any element in the range [first,last).
        Returns:
      • copy

        public static <T> int copy(java.util.List<T> from,
                                   int first,
                                   int last,
                                   java.util.List<T> to,
                                   int toFrom)
      • fill

        public static <T> void fill(java.util.List<T> array,
                                    int from,
                                    int last,
                                    T value)
      • equal

        public static <T> boolean equal(java.util.List<T> first,
                                        int from,
                                        int last,
                                        java.util.List<T> second,
                                        int secondFrom)
        Test whether the elements in two ranges are equal Compares the elements in the range [first1,last1) with those in the range beginning at first2, and returns true if the elements in both ranges are considered equal. The elements are compared by either applying the == comparison operator to each pair of corresponding elements, or the template parameter pred (for the second version)\ The behavior of this function template is equivalent to template bool equal ( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 ) { while ( first1!=last1 ) { if (*first1 != *first2) // or: if (!pred(*first1,*first2)), for pred version return false; ++first1; ++first2; } return true; }
        Parameters:
        array -
        size -
        to -
        i -
        Returns:
      • equal

        public static <T> boolean equal(java.util.List<T> first,
                                        java.util.List<T> second)
      • transform

        public static <T extends java.lang.Number> int transform(java.util.List<T> list1,
                                                                 int first1,
                                                                 int last1,
                                                                 java.util.List<T> list2,
                                                                 int first2,
                                                                 java.util.List<T> result,
                                                                 Std.BinaryOperator<T> binaryOp)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.