org.eclipse.collections.api.set.MutableSet.toImmutable()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.eclipse.collections.api.set.MutableSet.toImmutable()方法的一些代码示例,展示了MutableSet.toImmutable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MutableSet.toImmutable()方法的具体详情如下:
包路径:org.eclipse.collections.api.set.MutableSet
类名称:MutableSet
方法名:toImmutable

MutableSet.toImmutable介绍

暂无

代码示例

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<Pair<V, Integer>> zipWithIndex()
{
  return this.delegate.zipWithIndex().toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<Pair<V, Integer>> zipWithIndex()
{
  return this.delegate.zipWithIndex().toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<Pair<V, Integer>> zipWithIndex()
{
  return this.delegate.zipWithIndex().toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<Pair<V, Integer>> zipWithIndex()
{
  return this.delegate.zipWithIndex().toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<Pair<V, Integer>> zipWithIndex()
{
  return this.delegate.zipWithIndex().toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<T> difference(SetIterable<? extends T> subtrahendSet)
{
  return SetIterables.difference(this, subtrahendSet).toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<Pair<V, Integer>> zipWithIndex()
{
  return this.delegate.zipWithIndex().toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
  int size = in.readInt();
  MutableSet<T> deserializedSet = UnifiedSet.newSet(size);
  for (int i = 0; i < size; i++)
  {
    deserializedSet.add((T) in.readObject());
  }
  this.set = deserializedSet.toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
  int size = in.readInt();
  MutableSet<T> deserializedSet = UnifiedSet.newSet(size);
  for (int i = 0; i < size; i++)
  {
    deserializedSet.add((T) in.readObject());
  }
  this.set = deserializedSet.toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public <P> ImmutableSet<V> selectWith(Predicate2<? super V, ? super P> predicate, P parameter)
{
  return this.delegate.selectWith(predicate, parameter, Sets.mutable.empty()).toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<V> select(Predicate<? super V> predicate)
{
  return this.delegate.select(predicate, Sets.mutable.empty()).toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<T> newWithoutAll(Iterable<? extends T> elements)
{
  MutableSet<T> result = UnifiedSet.newSet(this);
  this.removeAllFrom(elements, result);
  return result.toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

/**
 * Returns an Immutable version of powerset where the inner sets are also immutable.
 */
public static <T> ImmutableSet<ImmutableSet<T>> immutablePowerSet(Set<T> set)
{
  return powerSet(set).collect(MutableSet::toImmutable).toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<T> newWithout(T element)
{
  if (this.contains(element))
  {
    MutableSet<T> result = UnifiedSet.newSet(this);
    result.remove(element);
    return result.toImmutable();
  }
  return this;
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public <V> ImmutableSet<V> collect(CharToObjectFunction<? extends V> function)
{
  MutableSet<V> set = this.collect(function, UnifiedSet.newSet(this.size()));
  return set.toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSet<T> newWith(T element)
{
  if (!this.contains(element))
  {
    MutableSet<T> result = UnifiedSet.newSet(this);
    result.add(element);
    return result.toImmutable();
  }
  return this;
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public <V> ImmutableSet<V> collect(Function<? super T, ? extends V> function)
{
  MutableSet<V> result = UnifiedSet.newSet();
  this.forEach(new CollectProcedure<>(function, result));
  return result.toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public <V> ImmutableSet<V> flatCollect(Function<? super T, ? extends Iterable<V>> function)
{
  MutableSet<V> result = UnifiedSet.newSet();
  this.forEach(new FlatCollectProcedure<>(function, result));
  return result.toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public <V> ImmutableSet<V> collect(IntToObjectFunction<? extends V> function)
{
  MutableSet<V> set = this.collect(function, UnifiedSet.newSet(this.size()));
  return set.toImmutable();
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public ImmutableSetMultimap<K, V> toImmutable()
{
  MutableMap<K, ImmutableSet<V>> map = UnifiedMap.newMap();
  this.map.forEachKeyValue((key, set) -> map.put(key, set.toImmutable()));
  return new ImmutableSetMultimapImpl<>(map);
}

相关文章

微信公众号

最新文章

更多