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 <TSource,TResult>
      Iterable<TResult>
      cast(Iterable<TSource> source, Class<TResult> cls) 
      static byte[] ConcatByteArrays(byte[]... arrays) 
      static <TSource> int count(Iterable<TSource> source) 
      static <TSource> int count(Iterable<TSource> source, com.aspose.ms.System.Predicate<TSource> predicate) 
      static byte[] createArray(byte initialVal, int length) 
      static <T> T[] createArray(Class<T> cls, T initialVal, int length) 
      static <TSource> TSource elementAt(Iterable<TSource> source, int index) 
      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> Iterable<T> intersect(Iterable<T> a1, Iterable<T> a2) 
      static <TSource> TSource last(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<TSource> source) 
      static <TSource> TSource last(Iterable<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> T[] ToArray(Class<T> cls, Iterable<T> collection) 
      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 String toString(byte[] buffer) 
      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.
      static <TSource> Iterable<TSource> where(Iterable<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)
      • ToArray

        public static <T> T[] ToArray(Class<T> cls,
                                      Iterable<T> collection)
      • 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> Iterable<TSource> where(Iterable<TSource> source,
                                                        com.aspose.ms.System.Predicate<TSource> predicate)

        Gets a filtered enumerable according to a specified predicate.

      • 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)
      • last

        public static <TSource> TSource last(Iterable<TSource> source)
      • elementAt

        public static <TSource> TSource elementAt(Iterable<TSource> source,
                                                  int index)
      • 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(Iterable<TSource> source)
      • count

        public static <TSource> int count(Iterable<TSource> source,
                                          com.aspose.ms.System.Predicate<TSource> predicate)
      • cast

        public static <TSource,TResult> Iterable<TResult> cast(Iterable<TSource> source,
                                                               Class<TResult> cls)
      • createArray

        public static <T> T[] createArray(Class<T> cls,
                                          T initialVal,
                                          int length)
      • createArray

        public static byte[] createArray(byte initialVal,
                                         int length)
      • toString

        public static String toString(byte[] buffer)