// // 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)); }
/// <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); }
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); } }
public static bool ContainsAll(IExtendedCollection c1, ICollection c2) { return(c1.ContainsAll(c2)); }
public static bool Contains(object e, IExtendedCollection c) { return(c.Contains(e)); }
public static void Clear(IExtendedCollection c) { c.Clear(); }
public static object[] ToArray(IExtendedCollection c, object[] arr) { return(c.ToArray(arr)); }
public static bool RetainAll(IExtendedCollection c1, ICollection c2) { return(c1.RetainAll(c2)); }
public static bool RetainAll(IExtendedCollection c1, ICollection c2) { return c1.RetainAll(c2); }
public static bool Remove(IExtendedCollection c, object e) { return (((e != null) && c.Contains(e)) && c.Remove(e)); }
public static bool Add(IExtendedCollection c, object e) { return c.Add(e); }
public static bool ContainsAll(IExtendedCollection c1, ICollection c2) { return c1.ContainsAll(c2); }
public static bool Contains(object e, IExtendedCollection c) { return c.Contains(e); }
public static bool Add(IExtendedCollection c, object e) { return(c.Add(e)); }
public static bool Remove(IExtendedCollection c, object e) { return(((e != null) && c.Contains(e)) && c.Remove(e)); }
public static object[] ToArray(IExtendedCollection c) { return c.ToArray(); }
public static object[] ToArray(IExtendedCollection c) { return(c.ToArray()); }
public static object[] ToArray(IExtendedCollection c, object[] arr) { return c.ToArray(arr); }
public static bool AddAll(ICollection c1, IExtendedCollection c2) { return(c2.AddAll(c1)); }
public static bool AddAll(ICollection c1, IExtendedCollection c2) { return c2.AddAll(c1); }