Class MutableCollectionViews

java.lang.Object
org.aksw.commons.collections.MutableCollectionViews

public class MutableCollectionViews extends Object
  • Constructor Details

    • MutableCollectionViews

      public MutableCollectionViews()
  • Method Details

    • filteringCollection

      public static <T> Collection<T> filteringCollection(Collection<T> backend, com.google.common.base.Converter<? super T,?> converter)
      Return a live-view of the given collection with conflicting elements filtered out. Conflicting elements are those for which the converter raises an exception.
      Type Parameters:
      T -
      Parameters:
      backend -
      converter -
      Returns:
    • filteringSet

      public static <T> Set<T> filteringSet(Set<T> backend, com.google.common.base.Converter<? super T,?> converter)
    • filteringList

      public static <T> List<T> filteringList(List<T> backend, com.google.common.base.Converter<? super T,?> converter)
      There is no guava Lists.filter() Reason: https://stackoverflow.com/questions/8458663/guava-why-is-there-no-lists-filter-function
      Type Parameters:
      T -
      Parameters:
      backend -
      converter -
      Returns:
    • convertingCollection

      public static <T, U> Collection<U> convertingCollection(Collection<T> backend, com.google.common.base.Converter<T,U> converter)
    • convertingSet

      public static <T, U> Set<U> convertingSet(Set<T> backend, com.google.common.base.Converter<T,U> converter, boolean isInjective)
    • convertingList

      public static <T, U> List<U> convertingList(List<T> backend, com.google.common.base.Converter<T,U> converter)
    • wrapAsSet

      public static <T> Set<T> wrapAsSet(Collection<T> collection)