Example #1
0
        /// <summary> Method will create a Fact from the given object instance
        ///
        /// </summary>
        /// <param name="">data
        /// </param>
        /// <returns>
        ///
        /// </returns>
        public virtual IFact createFact(Object data, Defclass clazz, long id)
        {
            // first we clone the slots
            Slot[] values = cloneAllSlots();
            // now we set the values
            for (int idx = 0; idx < values.Length; idx++)
            {
                Object val = clazz.getSlotValue(idx, data);
                if (val == null)
                {
                    values[idx].Value = Constants.NIL_SYMBOL;
                }
                else
                {
                    values[idx].Value = val;
                }
            }
            Deffact newfact = new Deffact(this, data, values, id);

            return(newfact);
        }
Example #2
0
 /// <summary> Method will create a Fact from the given object instance
 /// 
 /// </summary>
 /// <param name="">data
 /// </param>
 /// <returns>
 /// 
 /// </returns>
 public virtual IFact createFact(Object data, Defclass clazz, long id)
 {
     // first we clone the slots
     Slot[] values = cloneAllSlots();
     // now we set the values
     for (int idx = 0; idx < values.Length; idx++)
     {
         Object val = clazz.getSlotValue(idx, data);
         if (val == null)
         {
             values[idx].Value = Constants.NIL_SYMBOL;
         }
         else
         {
             values[idx].Value = val;
         }
     }
     Deffact newfact = new Deffact(this, data, values, id);
     return newfact;
 }
Example #3
0
        /// <summary> The implementation gets the Defclass and passes the
        /// objectInstance to invoke the read method.
        /// </summary>

        public override Object getSlotValue(int id)
        {
            return(dclazz.getSlotValue(id, objInstance));
        }