Ejemplo n.º 1
0
        //
        // Remove
        //

        /// <summary>
        ///
        /// </summary>
        /// <param name="c"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        public static bool Remove(IExtendedCollection c, object e)
        {
            if (e == null || !c.Contains(e))
            {
                return(false);
            }
            return(c.Remove(e));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Деление узла.
        /// </summary>
        /// <returns>Появившийся в результате деления узел.</returns>
        public override TreeNode <T> Split()
        {
            int from  = Keys.Count / 2 + 1;
            int count = Keys.Count - from;
            InternalNode <T> sibling = Factory.CreateInternalNode(Factor);

            sibling.Keys.AddRange(Keys.GetRange(from, count));
            sibling.Children.AddRange(Children.GetRange(from, count + 1));

            Keys     = Keys.GetRange(0, from - 1);
            Children = Children.GetRange(0, from);
            return(sibling);
        }
Ejemplo n.º 3
0
        private void ParseNodes(ObjectModel objectNode, IExtendedCollection <INode> target)
        {
            var classes = GetStringArray(objectNode, "Class");

            foreach (var @class in classes)
            {
                target.Add(new Class(@class));
            }

            var rels = GetStringArray(objectNode, "Rel");

            foreach (var rel in rels)
            {
                target.Add(new Rel(rel));
            }

            var entities = GetObjectArray(objectNode, "Entities");

            foreach (var entity in entities)
            {
                var child = ParseMedia(entity);
                target.Add(child);
            }

            var selfProperties = ParseProperties(objectNode,
                                                 exceptions: new[] { "Class", "Rel", "Entities", "Properties", "Links" }
                                                 );

            target.AddMany(selfProperties);

            var @object = GetObject(objectNode, "Properties");

            if (@object != null)
            {
                var otherProperties = ParseProperties(@object);
                target.AddMany(otherProperties);
            }

            var links = GetObjectArray(objectNode, "Links");

            foreach (var link in links)
            {
                var child = ParseLink(link);
                target.Add(child);
            }
        }
Ejemplo n.º 4
0
 public static bool ContainsAll(IExtendedCollection c1, ICollection c2)
 {
     return(c1.ContainsAll(c2));
 }
Ejemplo n.º 5
0
 public static bool Contains(object e, IExtendedCollection c)
 {
     return(c.Contains(e));
 }
Ejemplo n.º 6
0
 public static void Clear(IExtendedCollection c)
 {
     c.Clear();
 }
Ejemplo n.º 7
0
 public static object[] ToArray(IExtendedCollection c, object[] arr)
 {
     return(c.ToArray(arr));
 }
Ejemplo n.º 8
0
 public static bool RetainAll(IExtendedCollection c1, ICollection c2)
 {
     return(c1.RetainAll(c2));
 }
Ejemplo n.º 9
0
 public static bool RetainAll(IExtendedCollection c1, ICollection c2)
 {
     return c1.RetainAll(c2);
 }
Ejemplo n.º 10
0
 public static bool Remove(IExtendedCollection c, object e)
 {
     return (((e != null) && c.Contains(e)) && c.Remove(e));
 }
Ejemplo n.º 11
0
 public static bool Add(IExtendedCollection c, object e)
 {
     return c.Add(e);
 }
Ejemplo n.º 12
0
 public static bool ContainsAll(IExtendedCollection c1, ICollection c2)
 {
     return c1.ContainsAll(c2);
 }
Ejemplo n.º 13
0
 public static bool Contains(object e, IExtendedCollection c)
 {
     return c.Contains(e);
 }
Ejemplo n.º 14
0
 public static void Clear(IExtendedCollection c)
 {
     c.Clear();
 }
Ejemplo n.º 15
0
 public static bool Add(IExtendedCollection c, object e)
 {
     return(c.Add(e));
 }
Ejemplo n.º 16
0
 public static bool Remove(IExtendedCollection c, object e)
 {
     return(((e != null) && c.Contains(e)) && c.Remove(e));
 }
Ejemplo n.º 17
0
 public static object[] ToArray(IExtendedCollection c)
 {
     return c.ToArray();
 }
Ejemplo n.º 18
0
 public static object[] ToArray(IExtendedCollection c)
 {
     return(c.ToArray());
 }
Ejemplo n.º 19
0
 public static object[] ToArray(IExtendedCollection c, object[] arr)
 {
     return c.ToArray(arr);
 }
Ejemplo n.º 20
0
 public static bool AddAll(ICollection c1, IExtendedCollection c2)
 {
     return(c2.AddAll(c1));
 }
Ejemplo n.º 21
0
 public static bool AddAll(ICollection c1, IExtendedCollection c2)
 {
     return c2.AddAll(c1);
 }