public boolean hasNext() { return seq.size()>0 || i.hasNext(); }
public boolean hasNext() { return seq.size()>0 || i.hasNext(); }
public HashPMap<K,V> plus(final K key, final V value) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int size0 = entries.size(), i = keyIndexIn(entries, key); if(i!=-1) entries = entries.minus(i); entries = entries.plus(new SimpleImmutableEntry<K,V>(key, value)); return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-size0+entries.size()); }
public HashPMap<K,V> plus(final K key, final V value) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int size0 = entries.size(), i = keyIndexIn(entries, key); if(i!=-1) entries = entries.minus(i); entries = entries.plus(new SimpleImmutableEntry<K,V>(key, value)); return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-size0+entries.size()); }
public HashPMap<K,V> minus(final Object key) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int i = keyIndexIn(entries, key); if(i==-1) // key not in this return this; entries = entries.minus(i); if(entries.size()==0) // get rid of the entire hash entry return new HashPMap<K,V>(intMap.minus(key.hashCode()), size-1); // otherwise replace hash entry with new smaller one: return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-1); }
public HashPMap<K,V> minus(final Object key) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int i = keyIndexIn(entries, key); if(i==-1) // key not in this return this; entries = entries.minus(i); if(entries.size()==0) // get rid of the entire hash entry return new HashPMap<K,V>(intMap.minus(key.hashCode()), size-1); // otherwise replace hash entry with new smaller one: return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-1); }
size0 = pseq.size(); inBounds = j>=0 && j<=pseq.size(); pseq = pseq.plus(j, r.nextInt()); if (!inBounds) fail(); size0 = pseq.size(); inBounds = j>=0 && j<=pseq.size(); pseq = pseq.plusAll(j, TreePVector.singleton(r.nextInt())); if (!inBounds) fail(); size0 = pseq.size(); inBounds = j>=0 && j<pseq.size(); pseq = pseq.with(j, r.nextInt()); if (!inBounds) fail(); size0 = pseq.size(); inBounds = j>=0 && j<pseq.size(); pseq = pseq.minus(j); if (!inBounds) fail();
public boolean hasNext() { return seq.size() > 0 || i.hasNext(); }
public boolean hasNext() { return seq.size()>0 || i.hasNext(); }
public HashPMap<K,V> plus(final K key, final V value) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int size0 = entries.size(), i = keyIndexIn(entries, key); if(i!=-1) entries = entries.minus(i); entries = entries.plus(new SimpleImmutableEntry<K,V>(key, value)); return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-size0+entries.size()); }
public HashPMap<K, V> plus(final K key, final V value) { PSequence<Entry<K, V>> entries = getEntries(key.hashCode()); int size0 = entries.size(), i = keyIndexIn(entries, key); if (i != -1) entries = entries.minus(i); entries = entries.plus(new org.pcollections.SimpleImmutableEntry<K, V>(key, value)); return new HashPMap<K, V>(intMap.plus(key.hashCode(), entries), size - size0 + entries.size()); }
public HashPMap<K, V> minus(final Object key) { PSequence<Entry<K, V>> entries = getEntries(key.hashCode()); int i = keyIndexIn(entries, key); if (i == -1) // key not in this return this; entries = entries.minus(i); if (entries.size() == 0) // get rid of the entire hash entry return new HashPMap<K, V>(intMap.minus(key.hashCode()), size - 1); // otherwise replace hash entry with new smaller one: return new HashPMap<K, V>(intMap.plus(key.hashCode(), entries), size - 1); }
public HashPMap<K,V> minus(final Object key) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int i = keyIndexIn(entries, key); if(i==-1) // key not in this return this; entries = entries.minus(i); if(entries.size()==0) // get rid of the entire hash entry return new HashPMap<K,V>(intMap.minus(key.hashCode()), size-1); // otherwise replace hash entry with new smaller one: return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-1); }