com.aspose.note.infrastructure

Class CollectionExtensions



  • public class CollectionExtensions
    extends Object

    The collection extensions.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static <T> boolean All(Iterable<T> collection, com.aspose.ms.System.Predicate<T> predicate) 
      static <T> boolean Any(Iterable<T> collection) 
      static <T> boolean Any(Iterable<T> collection, com.aspose.ms.System.Predicate<T> predicate) 
      static <T> boolean ArrayContains(T[] array, T element) 
      static <T> boolean bagsEqual(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a1, com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a2)
      The equals.
      static byte[] ConcatByteArrays(byte[]... arrays) 
      static <TSource> int count(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source) 
      static boolean equals(com.aspose.ms.System.Collections.BitArray a1, com.aspose.ms.System.Collections.BitArray a2)
      The equals.
      static boolean equals(byte[] a1, byte[] a2)
      The equals.
      static <T> boolean equals(com.aspose.ms.System.Collections.Generic.IGenericCollection<T> a1, com.aspose.ms.System.Collections.Generic.IGenericCollection<T> a2)
      The equals.
      static boolean equals(int[] a1, int[] a2)
      The equals.
      static <TSource> TSource first(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source)
      Returns first element of the sequence, or default value if wasn't found.
      static <TSource> TSource firstOrDefault(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source)
      Returns first element of the sequence, or default value if wasn't found.
      static <TSource> TSource firstOrDefault(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source, com.aspose.ms.System.Predicate<TSource> predicate)
      Returns first element of the sequence, or default value if wasn't found.
      static <TSource> int indexOf(com.aspose.ms.System.Collections.Generic.IGenericList<TSource> source, com.aspose.ms.System.Predicate<TSource> predicate)
      The index of method.
      static <T> com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> intersect(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a1, com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a2) 
      static <TSource> TSource last(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source) 
      static <TResult> com.aspose.ms.System.Collections.Generic.List<TResult> ofType(Class<TResult> typeParameterClass, Iterable enumerable)
      Returns new enumerable, which contains only an elements of the specified type.
      static <T> ArrayList<T> ToArrayList(Iterable<T> iterable) 
      static byte[] ToByteArray(com.aspose.ms.System.Collections.Generic.IGenericList<Byte> byteList) 
      static int[] ToIntArray(com.aspose.ms.System.Collections.Generic.IGenericList<Integer> byteList) 
      static <TKey,TValue>
      boolean
      tryInvertDictionary(com.aspose.ms.System.Collections.Generic.IGenericDictionary<TKey,TValue> originalDictionary, com.aspose.ms.System.Collections.Generic.IGenericDictionary<TValue,TKey>[] invertedDictionary) 
      static <TSource> com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> where(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source, com.aspose.ms.System.Predicate<TSource> predicate)
      Gets a filtered enumerable according to a specified predicate.
    • Constructor Detail

      • CollectionExtensions

        public CollectionExtensions()
    • Method Detail

      • equals

        public static <T> boolean equals(com.aspose.ms.System.Collections.Generic.IGenericCollection<T> a1,
                                         com.aspose.ms.System.Collections.Generic.IGenericCollection<T> a2)

        The equals.

        Parameters:
        a1 - The a 1.
        a2 - The a 2.

        T:

        Returns:
        The bool.
      • ConcatByteArrays

        public static byte[] ConcatByteArrays(byte[]... arrays)
      • ToByteArray

        public static byte[] ToByteArray(com.aspose.ms.System.Collections.Generic.IGenericList<Byte> byteList)
      • ToIntArray

        public static int[] ToIntArray(com.aspose.ms.System.Collections.Generic.IGenericList<Integer> byteList)
      • ArrayContains

        public static <T> boolean ArrayContains(T[] array,
                                                T element)
      • All

        public static <T> boolean All(Iterable<T> collection,
                                      com.aspose.ms.System.Predicate<T> predicate)
      • Any

        public static <T> boolean Any(Iterable<T> collection)
      • Any

        public static <T> boolean Any(Iterable<T> collection,
                                      com.aspose.ms.System.Predicate<T> predicate)
      • bagsEqual

        public static <T> boolean bagsEqual(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a1,
                                            com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a2)

        The equals.

        Parameters:
        a1 - The a 1.
        a2 - The a 2.

        T:

        Returns:
        The bool.
      • equals

        public static boolean equals(com.aspose.ms.System.Collections.BitArray a1,
                                     com.aspose.ms.System.Collections.BitArray a2)

        The equals.

        Parameters:
        a1 - The a 1.
        a2 - The a 2.
        Returns:
        The bool.
      • equals

        public static boolean equals(int[] a1,
                                     int[] a2)

        The equals.

        Parameters:
        a1 - The a 1.
        a2 - The a 2.
        Returns:
        The bool.
      • equals

        public static boolean equals(byte[] a1,
                                     byte[] a2)

        The equals.

        Parameters:
        a1 - The a 1.
        a2 - The a 2.
        Returns:
        The bool.
      • ofType

        public static <TResult> com.aspose.ms.System.Collections.Generic.List<TResult> ofType(Class<TResult> typeParameterClass,
                                                                                              Iterable enumerable)

        Returns new enumerable, which contains only an elements of the specified type.

      • where

        public static <TSource> com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> where(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source,
                                                                                                           com.aspose.ms.System.Predicate<TSource> predicate)

        Gets a filtered enumerable according to a specified predicate.

      • first

        public static <TSource> TSource first(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source)

        Returns first element of the sequence, or default value if wasn't found.

      • firstOrDefault

        public static <TSource> TSource firstOrDefault(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source)

        Returns first element of the sequence, or default value if wasn't found.

      • firstOrDefault

        public static <TSource> TSource firstOrDefault(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source,
                                                       com.aspose.ms.System.Predicate<TSource> predicate)

        Returns first element of the sequence, or default value if wasn't found.

      • indexOf

        public static <TSource> int indexOf(com.aspose.ms.System.Collections.Generic.IGenericList<TSource> source,
                                            com.aspose.ms.System.Predicate<TSource> predicate)

        The index of method.

      • last

        public static <TSource> TSource last(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source)
      • tryInvertDictionary

        public static <TKey,TValue> boolean tryInvertDictionary(com.aspose.ms.System.Collections.Generic.IGenericDictionary<TKey,TValue> originalDictionary,
                                                                com.aspose.ms.System.Collections.Generic.IGenericDictionary<TValue,TKey>[] invertedDictionary)
      • count

        public static <TSource> int count(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source)
      • intersect

        public static <T> com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> intersect(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a1,
                                                                                                   com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> a2)