}
private class Iterator<G> : Object, Gee.Iterator<G>, BidirIterator<G>, ListIterator<G> {
- public ArrayList<G> list {
- construct {
- _list = value;
- _stamp = _list._stamp;
- }
- }
-
private ArrayList<G> _list;
private int _index = -1;
private bool _removed = false;
private int _stamp = 0;
public Iterator (ArrayList list) {
- this.list = list;
+ _list = list;
+ _stamp = _list._stamp;
}
public bool next () {
this.key_hash_func = key_hash_func;
this.key_equal_func = key_equal_func;
this.value_equal_func = value_equal_func;
- }
- construct {
_array_size = MIN_SIZE;
_nodes = new Node<K,V>[_array_size];
}
}
private class KeySet<K,V> : AbstractSet<K> {
- public HashMap<K,V> map { private set; get; }
+ private HashMap<K,V> _map;
public KeySet (HashMap map) {
- this.map = map;
+ _map = map;
}
public override Iterator<K> iterator () {
- return new KeyIterator<K,V> (map);
+ return new KeyIterator<K,V> (_map);
}
public override int size {
- get { return map.size; }
+ get { return _map.size; }
}
public override bool add (K key) {
}
private class ValueCollection<K,V> : AbstractCollection<V> {
- public HashMap<K,V> map { private set; get; }
+ private HashMap<K,V> _map;
public ValueCollection (HashMap map) {
- this.map = map;
+ _map = map;
}
public override Iterator<V> iterator () {
- return new ValueIterator<K,V> (map);
+ return new ValueIterator<K,V> (_map);
}
public override int size {
- get { return map.size; }
+ get { return _map.size; }
}
public override bool add (V value) {
public override bool contains (V value) {
Iterator<V> it = iterator ();
while (it.next ()) {
- if (map.value_equal_func (it.get (), value)) {
+ if (_map.value_equal_func (it.get (), value)) {
return true;
}
}
}
private abstract class NodeIterator<K,V> : Object {
- public HashMap<K,V> map {
- private set {
- _map = value;
- _stamp = _map._stamp;
- }
- }
-
protected HashMap<K,V> _map;
private int _index = -1;
protected weak Node<K,V> _node;
protected int _stamp;
public NodeIterator (HashMap map) {
- this.map = map;
+ _map = map;
+ _stamp = _map._stamp;
}
public bool next () {
}
private class Iterator<G> : Object, Gee.Iterator<G> {
- public new HashMultiSet<G> set { construct; get; }
+ private HashMultiSet<G> _set;
private Gee.UpdatableKeyIterator<G, int> _iter;
private int _pending = 0;
private bool _removed = false;
- construct {
- _iter = set._items.updatable_key_iterator ();
- }
-
public Iterator (HashMultiSet<G> set) {
- this.set = set;
+ _set = set;
+ _iter = _set._items.updatable_key_iterator ();
}
public bool next () {
}
public bool first () {
- if (set._nitems == 0) {
+ if (_set._nitems == 0) {
return false;
}
_pending = 0;
}
private class Iterator<G> : Object, Gee.Iterator<G> {
- public new HashSet<G> set {
- construct {
- _set = value;
- _stamp = _set._stamp;
- }
- }
-
private HashSet<G> _set;
private int _index = -1;
private weak Node<G> _node;
private int _stamp = 0;
public Iterator (HashSet set) {
- this.set = set;
+ _set = set;
+ _stamp = _set._stamp;
}
public bool next () {
private int stamp = 0;
private class KeySet<K,V> : AbstractSet<K> {
- public TreeMap<K,V> map { private set; get; }
+ private TreeMap<K,V> _map;
public KeySet (TreeMap<K,V> map) {
- this.map = map;
+ _map = map;
}
public override Iterator<K> iterator () {
- return new KeyIterator<K,V> (map);
+ return new KeyIterator<K,V> (_map);
}
public override int size {
- get { return map.size; }
+ get { return _map.size; }
}
public override bool add (K key) {
}
public override bool contains (K key) {
- return map.contains (key);
+ return _map.contains (key);
}
public override bool add_all (Collection<K> collection) {
}
private class ValueCollection<K,V> : AbstractCollection<V> {
- public TreeMap<K,V> map { private set; get; }
+ private TreeMap<K,V> _map;
public ValueCollection (TreeMap<K,V> map) {
- this.map = map;
+ _map = map;
}
public override Iterator<V> iterator () {
- return new ValueIterator<K,V> (map);
+ return new ValueIterator<K,V> (_map);
}
public override int size {
- get { return map.size; }
+ get { return _map.size; }
}
public override bool add (V key) {
public override bool contains (V key) {
Iterator<V> it = iterator ();
while (it.next ()) {
- if (map.value_equal_func (key, it.get ())) {
+ if (_map.value_equal_func (key, it.get ())) {
return true;
}
}
}
private class KeyIterator<K,V> : Object, Gee.Iterator<K>, BidirIterator<K> {
- public TreeMap<K,V> map {
- private set {
- _map = value;
- stamp = _map.stamp;
- }
- }
-
private TreeMap<K,V> _map;
// concurrent modification protection
private int stamp;
public KeyIterator (TreeMap<K,V> map) {
- this.map = map;
+ _map = map;
+ stamp = _map.stamp;
}
public bool next () {
}
private class ValueIterator<K,V> : Object, Gee.Iterator<V>, Gee.BidirIterator<V> {
- public TreeMap<K,V> map {
- private set {
- _map = value;
- stamp = _map.stamp;
- }
- }
-
private TreeMap<K,V> _map;
// concurrent modification protection
private int stamp;
public ValueIterator (TreeMap<K,V> map) {
- this.map = map;
+ _map = map;
+ stamp = _map.stamp;
}
public bool next () {
}
private class Iterator<G> : Object, Gee.Iterator<G>, BidirIterator<G> {
- public new TreeSet<G> set {
- private set {
- _set = value;
- stamp = _set.stamp;
- }
- }
-
private TreeSet<G> _set;
// concurrent modification protection
private int stamp;
public Iterator (TreeSet<G> set) {
- this.set = set;
+ _set = set;
+ stamp = _set.stamp;
}
public bool next () {