コード例 #1
0
 /// <summary>
 ///Retrieve (R) - utilize the Find method and return the object if the collection contains an item equal to obj,
 ///and in that case binds one such item to the ref parameter obj; otherwise returns default object
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public T Retrieve(T obj)
 {
     if (InternalC5DataStructure.Find(ref obj))
     {
         return(obj);
     }
     else
     {
         return(default(T));//this is just for testing
     }
 }
コード例 #2
0
 /// <summary>
 /// This is not a part of CRUD operation. It is for clearing elements during the experiments
 /// </summary>
 public void Clear()
 {
     InternalC5DataStructure.Clear();
 }
コード例 #3
0
 /// <summary>
 ///Delete (D)-attempts to remove an item equal to obj from the collection.
 ///Returns true if the collection did contain an item equal to obj, false if it did not.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>true or false</returns>
 public bool Delete(T obj)
 {
     return(InternalC5DataStructure.Remove(obj));
 }
コード例 #4
0
 /// <summary>
 ///Update (U)-returns true if the collection contains an item equal to obj,
 ///in which case that item is replaced by obj; otherwise returns false without modifying
 ///the collection.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>true or false</returns>
 public bool Update(T obj)
 {
     return(InternalC5DataStructure.Update(obj));
 }
コード例 #5
0
 /// <summary>
 ///Create (C) - utilize the Add method to attempt to add item obj to the collection.
 ///Returns true if the item was added; returns false if it was not.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public bool Create(T obj)
 {
     return(InternalC5DataStructure.Add(obj));
 }