public static <T> PSetX<T> singleton(T value){ return new PSetXImpl<>(HashTreePSet.singleton(value)); } public static<T> PSetX<T> fromCollection(Collection<T> stream){
public static <T> PSet<T> singleton(T value){ return new PSetXImpl<>(HashTreePSet.singleton(value)); } public static<T> PSet<T> fromCollection(Collection<T> stream){
void release(Class type,ProxyWrapper proxy){ mergeProxies(type,HashTreePSet.singleton(proxy)); } }
void release(Class type,ProxyWrapper proxy){ mergeProxies(type,HashTreePSet.singleton(proxy)); } }
void release(Class type,ProxyWrapper proxy){ mergeProxies(type,HashTreePSet.singleton(proxy)); } }
public static <T> PersistentSetX<T> singleton(final T value) { return new LazyPSetX<>( HashTreePSet.singleton(value),null,Reducers.toPSet(), LAZY); } PersistentSetX<T> type(Reducer<? extends PSet<T>> reducer);
public static <T> Monoid<PSet<T>> toPSet() { return Monoid.<PSet<T>>of(HashTreePSet.empty(), (PSet<T> a) -> b -> a.plusAll(b), (T x) -> HashTreePSet.singleton(x)); } public static <T> Monoid<PVector<T>> toPVector() {
private PSet<ProxyWrapper> removeProxies(Class key){ val proxies = proxyCache.get(key); val proxiesToUse = proxies==null ? HashTreePSet.singleton(new ProxyWrapper((Proxy)Proxy.newProxyInstance(InvokeDynamicComprehender.class.getClassLoader(), new Class[]{key},new FunctionExecutionInvocationHandler()))) : proxies; if(proxies!=null) proxyCache = proxyCache.minus(key); return proxiesToUse; } private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){
private PSet<ProxyWrapper> removeProxies(Class key){ val proxies = proxyCache.get(key); val proxiesToUse = proxies==null ? HashTreePSet.singleton(new ProxyWrapper((Proxy)Proxy.newProxyInstance(InvokeDynamicComprehender.class.getClassLoader(), new Class[]{key},new FunctionExecutionInvocationHandler()))) : proxies; if(proxies!=null) proxyCache = proxyCache.minus(key); return proxiesToUse; } private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){
private PSet<ProxyWrapper> removeProxies(Class key){ val proxies = proxyCache.get(key); val proxiesToUse = proxies==null ? HashTreePSet.singleton(new ProxyWrapper((Proxy)Proxy.newProxyInstance(InvokeDynamicComprehender.class.getClassLoader(), new Class[]{key},new FunctionExecutionInvocationHandler()))) : proxies; if(proxies!=null) proxyCache = proxyCache.minus(key); return proxiesToUse; } private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){
/** * <pre> * {@code * PSet<Integer> q = Reducers.<Integer>toPSet() .mapReduce(Stream.of(1,2,3,4)); * * } * </pre> * @return Reducer for PSet */ public static <T> Reducer<PSet<T>> toPSet() { return Reducer.<PSet<T>> of(HashTreePSet.empty(), (final PSet<T> a) -> b -> a.plusAll(b), (final T x) -> HashTreePSet.singleton(x)); } /**
private PSet<ProxyWrapper> removeProxies(Class key){ val proxies = proxyCache.get(key); val proxiesToUse = proxies==null ? HashTreePSet.singleton(newProxyInstance(key,new InvocationHandlerProxy(key))) : proxies; if(proxies!=null) proxyCache = proxyCache.minus(key); return proxiesToUse; } private synchronized void mergeProxies(Class key,PSet<ProxyWrapper> proxies){