[gxml] Collections rename: removed Gom prefix



commit 873e6a8d6964593ddfe396bdf90163a3dcf5ae59
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Jul 5 21:48:31 2019 -0500

    Collections rename: removed Gom prefix

 gxml/{GomBaseCollection.vala => BaseCollection.vala} |  0
 gxml/Element.vala                                    |  2 +-
 gxml/{GomHashMap.vala => HashMap.vala}               |  4 ++--
 gxml/{GomHashPairedMap.vala => HashPairedMap.vala}   | 10 +++++-----
 gxml/{GomHashThreeMap.vala => HashThreeMap.vala}     | 14 +++++++-------
 gxml/XParser.vala                                    |  2 +-
 gxml/meson.build                                     |  8 ++++----
 test/ElementTest.vala                                |  6 +++---
 test/SerializationTest.vala                          | 18 +++++++++---------
 9 files changed, 32 insertions(+), 32 deletions(-)
---
diff --git a/gxml/GomBaseCollection.vala b/gxml/BaseCollection.vala
similarity index 100%
rename from gxml/GomBaseCollection.vala
rename to gxml/BaseCollection.vala
diff --git a/gxml/Element.vala b/gxml/Element.vala
index 5fad2db..42f9216 100644
--- a/gxml/Element.vala
+++ b/gxml/Element.vala
@@ -370,7 +370,7 @@ public class GXml.Element : GXml.Node,
    * and it's value as value. Appends namespace prefix to attribute's name as
    * key if is a namespaced attribute.
    */
-  public class Attributes : HashMap<string,DomNode>, DomNamedNodeMap  {
+  public class Attributes : Gee.HashMap<string,DomNode>, DomNamedNodeMap  {
     private TreeMap<long,string> order = new TreeMap<long,string> ();
     /**
      * Holds {@link GXml.Element} refrence to attributes' parent element.
diff --git a/gxml/GomHashMap.vala b/gxml/HashMap.vala
similarity index 98%
rename from gxml/GomHashMap.vala
rename to gxml/HashMap.vala
index 1a73301..efc44a8 100644
--- a/gxml/GomHashMap.vala
+++ b/gxml/HashMap.vala
@@ -51,7 +51,7 @@ using Gee;
  *   }
  * }}}
  */
-public class GXml.GomHashMap : GXml.BaseCollection, GXml.Map {
+public class GXml.HashMap : GXml.BaseCollection, GXml.Map {
   /**
    * A hashtable with all keys as string to node's index refered. Don't modify it manually.
    */
@@ -158,7 +158,7 @@ public class GXml.GomHashMap : GXml.BaseCollection, GXml.Map {
     return true;
   }
   public override void clear () {
-    _hashtable = new HashMap<string,int> ();
+    _hashtable = new Gee.HashMap<string,int> ();
   }
   public DomElement? item (string key) { return get (key); }
   public Gee.Set<string> keys_set {
diff --git a/gxml/GomHashPairedMap.vala b/gxml/HashPairedMap.vala
similarity index 96%
rename from gxml/GomHashPairedMap.vala
rename to gxml/HashPairedMap.vala
index 86c0e13..f7752d7 100644
--- a/gxml/GomHashPairedMap.vala
+++ b/gxml/HashPairedMap.vala
@@ -48,7 +48,7 @@ using Gee;
  *    public string get_map_primary_key () { return code; }
  *    public string get_map_secondary_key () { return name; }
  *   }
- *   public class YourList : GomHashPairedMap {
+ *   public class YourList : HashPairedMap {
  *    construct {
  *      try { initialize_with (typeof (YourObject)); }
  *      catch (GLib.Error e) {
@@ -59,11 +59,11 @@ using Gee;
  *   }
  * }}}
  */
-public class GXml.GomHashPairedMap : GXml.BaseCollection, GXml.PairedMap {
+public class GXml.HashPairedMap : GXml.BaseCollection, GXml.PairedMap {
   /**
    * A hashtable with all keys as string to node's index refered. Don't modify it manually.
    */
-  protected Gee.HashMap<string,HashMap<string,int>> _hashtable = new HashMap<string,HashMap<string,int>> ();
+  protected Gee.HashMap<string,Gee.HashMap<string,int>> _hashtable = new 
Gee.HashMap<string,Gee.HashMap<string,int>> ();
   /**
    * Element's attribute name used to refer of container's element as primery key.
    * You should define it at construction time
@@ -210,14 +210,14 @@ public class GXml.GomHashPairedMap : GXml.BaseCollection, GXml.PairedMap {
       throw new DomError.NOT_FOUND_ERROR (_("No primary key and/or secondary key was found"));
     var ht = _hashtable.get (pkey);
     if (ht == null) {
-      ht = new HashMap<string,int> ();
+      ht = new Gee.HashMap<string,int> ();
       _hashtable.set (pkey, ht);
     }
     ht.set (skey, index);
     return true;
   }
   public override void clear () {
-    _hashtable = new HashMap<string,HashMap<string,int>> ();
+    _hashtable = new Gee.HashMap<string,Gee.HashMap<string,int>> ();
   }
   public DomElement? item (string primary_key, string secondary_key) {
     return get (primary_key, secondary_key);
diff --git a/gxml/GomHashThreeMap.vala b/gxml/HashThreeMap.vala
similarity index 95%
rename from gxml/GomHashThreeMap.vala
rename to gxml/HashThreeMap.vala
index ca921f3..a6d7e3d 100644
--- a/gxml/GomHashThreeMap.vala
+++ b/gxml/HashThreeMap.vala
@@ -53,7 +53,7 @@ using Gee;
  *    public string get_map_secondary_key () { return name; }
  *    public string get_map_third_key () { return category; }
  *   }
- *   public class YourList : GomHashPairedMap {
+ *   public class YourList : HashPairedMap {
  *    construct {
  *      try { initialize_with (typeof (YourObject)); }
  *      catch (GLib.Error e) {
@@ -64,11 +64,11 @@ using Gee;
  *   }
  * }}}
  */
-public class GXml.GomHashThreeMap : GXml.BaseCollection, ThreeMap {
+public class GXml.HashThreeMap : GXml.BaseCollection, ThreeMap {
   /**
    * A hashtable with all keys as string to node's index refered. Don't modify it manually.
    */
-  protected HashMap<string,HashMap<string,HashMap<string,int>>> _hashtable = new 
HashMap<string,HashMap<string,HashMap<string,int>>> ();
+  protected Gee.HashMap<string,Gee.HashMap<string,Gee.HashMap<string,int>>> _hashtable = new 
Gee.HashMap<string,Gee.HashMap<string,Gee.HashMap<string,int>>> ();
   /**
    * Element's attribute name used to refer of container's element as primery key.
    * You should define it at construction time
@@ -109,7 +109,7 @@ public class GXml.GomHashThreeMap : GXml.BaseCollection, ThreeMap {
     get { return _attribute_third_key; } construct set { _attribute_third_key = value; }
   }
   /**
-   * Convenient function to initialize a {@link GomHashMap} collection, using
+   * Convenient function to initialize a {@link GXml.HashMap} collection, using
    * given element, items' type and name.
    */
   public void initialize_element_with_keys (GXml.Element element,
@@ -264,16 +264,16 @@ public class GXml.GomHashThreeMap : GXml.BaseCollection, ThreeMap {
     }
     if (pkey == null || skey == null || tkey == null) return false;
     var ht = _hashtable.get (pkey);
-    if (ht == null) ht = new HashMap<string,HashMap<string,int>> ();
+    if (ht == null) ht = new Gee.HashMap<string,Gee.HashMap<string,int>> ();
     var hte = ht.get (skey);
-    if (hte == null) hte = new HashMap<string,int> ();
+    if (hte == null) hte = new Gee.HashMap<string,int> ();
     if (!_hashtable.has_key (pkey)) _hashtable.set (pkey, ht);
     if (!ht.has_key (skey)) ht.set (skey, hte);
     hte.set (tkey, index);
     return true;
   }
   public override void clear () {
-    _hashtable = new HashMap<string,HashMap<string,HashMap<string,int>>> ();
+    _hashtable = new Gee.HashMap<string,Gee.HashMap<string,Gee.HashMap<string,int>>> ();
   }
 
   public DomElement? item (string primary_key, string secondary_key, string third_key) {
diff --git a/gxml/XParser.vala b/gxml/XParser.vala
index d4008ab..b4a7d3d 100644
--- a/gxml/XParser.vala
+++ b/gxml/XParser.vala
@@ -622,7 +622,7 @@ public class GXml.XParser : Object, GXml.Parser {
     foreach (string ak in (node as DomElement).attributes.keys) {
       Idle.add (start_node_async.callback);
       yield;
-      string v = ((node as DomElement).attributes as HashMap<string,string>).get (ak);
+      string v = ((node as DomElement).attributes as Gee.HashMap<string,string>).get (ak);
       if ("xmlns:" in ak) {
         string ns = (node as DomElement).namespace_uri;
         if (ns != null) {
diff --git a/gxml/meson.build b/gxml/meson.build
index a7bb52f..1eb6e4c 100644
--- a/gxml/meson.build
+++ b/gxml/meson.build
@@ -38,6 +38,7 @@ configure_file(output : 'config.h',
 valasources = files ([
        'ArrayList.vala',
        'Attr.vala',
+       'BaseCollection.vala',
        'Collections.vala',
        'CssSelectorParser.vala',
        'Document.vala',
@@ -54,14 +55,13 @@ valasources = files ([
        'Element.vala',
        'Enumeration.vala',
        'Event.vala',
-       'GomBaseCollection.vala',
-       'GomHashMap.vala',
-       'GomHashPairedMap.vala',
-       'GomHashThreeMap.vala',
        'GomObject.vala',
        'GomProperty.vala',
        'GomStringRef.vala',
        'gxml-init.vala',
+       'HashMap.vala',
+       'HashPairedMap.vala',
+       'HashThreeMap.vala',
        'HTMLCollection.vala',
        'IXsdSchema.vala',
        'LXPathObject.vala',
diff --git a/test/ElementTest.vala b/test/ElementTest.vala
index 4f5a7a7..8de24ce 100644
--- a/test/ElementTest.vala
+++ b/test/ElementTest.vala
@@ -116,7 +116,7 @@ class GXml.ElementTest : GXmlTest  {
                public Method.Map methods { get; set; }
                construct { initialize ("ingredient"); }
                public string get_map_key () { return cname; }
-               public class Map : GomHashMap {
+               public class Map : GXml.HashMap {
                        construct {
                                try {
                                        initialize (typeof (Ingredient));
@@ -129,7 +129,7 @@ class GXml.ElementTest : GXmlTest  {
                public string cname { get; set; }
                construct { initialize ("method"); }
                public string get_map_key () { return cname; }
-               public class Map : GomHashMap {
+               public class Map : GXml.HashMap {
                        construct {
                                try {
                                        initialize (typeof (Method));
@@ -201,7 +201,7 @@ class GXml.ElementTest : GXmlTest  {
     }
 
     public string get_map_key () { return name; }
-    public class Map : GomHashMap {
+    public class Map : GXml.HashMap {
       construct {
         try { initialize (typeof (TClass)); }
         catch (GLib.Error e) { warning ("Error: "+e.message); }
diff --git a/test/SerializationTest.vala b/test/SerializationTest.vala
index 68afa61..998abc9 100644
--- a/test/SerializationTest.vala
+++ b/test/SerializationTest.vala
@@ -51,7 +51,7 @@ class ThreeKey : GXml.Element, MappeableElementThreeKey {
   public string get_map_pkey () { return id; }
   public string get_map_skey () { return code; }
   public string get_map_tkey () { return name; }
-  public class Map : GomHashThreeMap {
+  public class Map : GXml.HashThreeMap {
     construct {
       try { initialize (typeof (ThreeKey)); }
       catch (GLib.Error e) { message ("Error: "+e.message); }
@@ -83,7 +83,7 @@ class Operation : GXml.Element, MappeableElementPairKey {
   construct { try { initialize ("Operation"); } catch { assert_not_reached (); } }
   public string get_map_primary_key () { return id; }
   public string get_map_secondary_key () { return code; }
-  public class Map : GomHashPairedMap {
+  public class Map : GXml.HashPairedMap {
     construct {
       try { initialize (typeof (Operation)); }
       catch (GLib.Error e) { message ("Error: "+e.message); }
@@ -128,7 +128,7 @@ class GomInventory : GXml.Element
   public string inventory { get; set; }
   construct { try { initialize ("Inventory"); } catch { assert_not_reached (); } }
   // FIXME: Add DualKeyMap implementation to GOM
-  public class DualKeyMap : GomHashMap {
+  public class DualKeyMap : GXml.HashMap {
     construct {
       try { initialize_with_key (typeof (GomInventory), "number"); }
       catch { assert_not_reached (); }
@@ -141,7 +141,7 @@ class GomCategory : GXml.Element
   [Description (nick="::Name")]
   public string name { get; set; }
   construct { try { initialize ("Category"); } catch { assert_not_reached (); } }
-  public class Map : GomHashMap {
+  public class Map : GXml.HashMap {
     construct {
       try { initialize_with_key (typeof (GomCategory), "name");  }
       catch { assert_not_reached (); }
@@ -157,7 +157,7 @@ class GomResume : GXml.Element
   [Description (nick="::Text")]
   public string text { get; set; }
   construct { try { initialize ("Resume"); } catch { assert_not_reached (); } }
-  public class Map : GomHashMap {
+  public class Map : GXml.HashMap {
     construct {
       try { initialize_with_key (typeof (GomResume), "chapter"); }
       catch { assert_not_reached (); }
@@ -427,25 +427,25 @@ class SerializationTest : GXmlTest  {
       catch { assert_not_reached (); }
     }
   }
-  public class HashRegisters : GomHashMap {
+  public class HashRegisters : GXml.HashMap {
     construct {
       try { initialize (typeof (BookRegister)); }
       catch { assert_not_reached (); }
     }
   }
-  public class HashPairRegisters : GomHashPairedMap {
+  public class HashPairRegisters : GXml.HashPairedMap {
     construct {
       try { initialize (typeof (BookRegister)); }
       catch { assert_not_reached (); }
     }
   }
-  public class HashThreeRegisters : GomHashThreeMap {
+  public class HashThreeRegisters : GXml.HashThreeMap {
     construct {
       try { initialize (typeof (BookRegister)); }
       catch { assert_not_reached (); }
     }
   }
-  public class Books : GomHashMap {
+  public class Books : GXml.HashMap {
     construct {
       try { initialize_with_key (typeof (Book), "Name"); }
       catch { assert_not_reached (); }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]