summaryrefslogtreecommitdiff
path: root/gee
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-03-20 12:10:54 +0100
committerJürg Billeter <j@bitron.ch>2010-03-20 12:10:54 +0100
commit98602e201c4032bac943ede2149f6de62a1d8f4f (patch)
tree856f4f52ca59126178d052101008266a038676ae /gee
parent898564ab223f016484bc792b7b32cfd6d7040f28 (diff)
downloadvala-98602e201c4032bac943ede2149f6de62a1d8f4f.tar.gz
Drop ReadOnly* collection classes
They are not very useful in the compiler as they are not immutable, which means that they do not allow iteration while modifying the underlying collection.
Diffstat (limited to 'gee')
-rw-r--r--gee/Makefile.am4
-rw-r--r--gee/readonlycollection.vala85
-rw-r--r--gee/readonlylist.vala113
-rw-r--r--gee/readonlymap.vala87
-rw-r--r--gee/readonlyset.vala85
5 files changed, 0 insertions, 374 deletions
diff --git a/gee/Makefile.am b/gee/Makefile.am
index 322ca63b6..5b358c56d 100644
--- a/gee/Makefile.am
+++ b/gee/Makefile.am
@@ -21,10 +21,6 @@ libgee_la_VALASOURCES = \
iterator.vala \
list.vala \
map.vala \
- readonlycollection.vala \
- readonlylist.vala \
- readonlymap.vala \
- readonlyset.vala \
set.vala \
$(NULL)
diff --git a/gee/readonlycollection.vala b/gee/readonlycollection.vala
deleted file mode 100644
index d0e34584c..000000000
--- a/gee/readonlycollection.vala
+++ /dev/null
@@ -1,85 +0,0 @@
-/* readonlycollection.vala
- *
- * Copyright (C) 2007-2008 Jürg Billeter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-using GLib;
-
-/**
- * Represents a read-only collection of items.
- */
-public class Vala.ReadOnlyCollection<G> : CollectionObject, Iterable<G>, Collection<G> {
- public int size {
- get { return _collection.size; }
- }
-
- public Collection<G> collection {
- set { _collection = value; }
- }
-
- private Collection<G> _collection;
-
- public ReadOnlyCollection (Collection<G>? collection = null) {
- this.collection = collection;
- }
-
- public Type get_element_type () {
- return typeof (G);
- }
-
- public Vala.Iterator<G> iterator () {
- if (_collection == null) {
- return new Iterator<G> ();
- }
-
- return _collection.iterator ();
- }
-
- public bool contains (G item) {
- if (_collection == null) {
- return false;
- }
-
- return _collection.contains (item);
- }
-
- public bool add (G item) {
- assert_not_reached ();
- }
-
- public bool remove (G item) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-
- private class Iterator<G> : CollectionObject, Vala.Iterator<G> {
- public bool next () {
- return false;
- }
-
- public G? get () {
- return null;
- }
- }
-}
-
diff --git a/gee/readonlylist.vala b/gee/readonlylist.vala
deleted file mode 100644
index d3793bf9a..000000000
--- a/gee/readonlylist.vala
+++ /dev/null
@@ -1,113 +0,0 @@
-/* readonlylist.vala
- *
- * Copyright (C) 2007-2008 Jürg Billeter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-using GLib;
-
-/**
- * Represents a read-only collection of items in a well-defined order.
- */
-public class Vala.ReadOnlyList<G> : CollectionObject, Iterable<G>, Collection<G>, List<G> {
- public int size {
- get { return _list.size; }
- }
-
- public List<G> list {
- set { _list = value; }
- }
-
- private List<G> _list;
-
- public ReadOnlyList (List<G>? list = null) {
- this.list = list;
- }
-
- public Type get_element_type () {
- return typeof (G);
- }
-
- public Vala.Iterator<G> iterator () {
- if (_list == null) {
- return new Iterator<G> ();
- }
-
- return _list.iterator ();
- }
-
- public bool contains (G item) {
- if (_list == null) {
- return false;
- }
-
- return _list.contains (item);
- }
-
- public int index_of (G item) {
- if (_list == null) {
- return -1;
- }
-
- return _list.index_of (item);
- }
-
- public bool add (G item) {
- assert_not_reached ();
- }
-
- public bool remove (G item) {
- assert_not_reached ();
- }
-
- public void insert (int index, G item) {
- assert_not_reached ();
- }
-
- public void remove_at (int index) {
- assert_not_reached ();
- }
-
- public G? get (int index) {
- if (_list == null) {
- return null;
- }
-
- return _list.get (index);
- }
-
- public void set (int index, G o) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-
- class Iterator<G> : CollectionObject, Vala.Iterator<G> {
- public bool next () {
- return false;
- }
-
- public G? get () {
- return null;
- }
- }
-}
-
diff --git a/gee/readonlymap.vala b/gee/readonlymap.vala
deleted file mode 100644
index 264cbee3e..000000000
--- a/gee/readonlymap.vala
+++ /dev/null
@@ -1,87 +0,0 @@
-/* readonlymap.vala
- *
- * Copyright (C) 2007-2008 Jürg Billeter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-using GLib;
-
-/**
- * Represents a read-only collection of key/value pairs.
- */
-public class Vala.ReadOnlyMap<K,V> : CollectionObject, Map<K,V> {
- public int size {
- get { return _map.size; }
- }
-
- public Map<K,V> map {
- set { _map = value; }
- }
-
- private Map<K,V> _map;
-
- public ReadOnlyMap (Map<K,V>? map = null) {
- this.map = map;
- }
-
- public Set<K> get_keys () {
- if (_map == null) {
- return new ReadOnlySet<K> ();
- }
-
- return _map.get_keys ();
- }
-
- public Collection<V> get_values () {
- if (_map == null) {
- return new ReadOnlyCollection<V> ();
- }
-
- return _map.get_values ();
- }
-
- public bool contains (K key) {
- if (_map == null) {
- return false;
- }
-
- return _map.contains (key);
- }
-
- public V? get (K key) {
- if (_map == null) {
- return null;
- }
-
- return _map.get (key);
- }
-
- public void set (K key, V value) {
- assert_not_reached ();
- }
-
- public bool remove (K key) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-}
-
diff --git a/gee/readonlyset.vala b/gee/readonlyset.vala
deleted file mode 100644
index 3d8034373..000000000
--- a/gee/readonlyset.vala
+++ /dev/null
@@ -1,85 +0,0 @@
-/* readonlyset.vala
- *
- * Copyright (C) 2007-2008 Jürg Billeter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-using GLib;
-
-/**
- * Represents a read-only collection of items without duplicates.
- */
-public class Vala.ReadOnlySet<G> : CollectionObject, Iterable<G>, Collection<G>, Set<G> {
- public int size {
- get { return _set.size; }
- }
-
- public Set<G> set {
- set { _set = value; }
- }
-
- private Set<G> _set;
-
- public ReadOnlySet (Set<G>? set = null) {
- this.set = set;
- }
-
- public Type get_element_type () {
- return typeof (G);
- }
-
- public Vala.Iterator<G> iterator () {
- if (_set == null) {
- return new Iterator<G> ();
- }
-
- return _set.iterator ();
- }
-
- public bool contains (G item) {
- if (_set == null) {
- return false;
- }
-
- return _set.contains (item);
- }
-
- public bool add (G item) {
- assert_not_reached ();
- }
-
- public bool remove (G item) {
- assert_not_reached ();
- }
-
- public void clear () {
- assert_not_reached ();
- }
-
- private class Iterator<G> : CollectionObject, Vala.Iterator<G> {
- public bool next () {
- return false;
- }
-
- public G? get () {
- return null;
- }
- }
-}
-