/// <summary> the class overrides the method to include the additional /// attributes. /// </summary> public override String toPPString() { StringBuilder buf = new StringBuilder(); buf.Append("(" + deftemplate.Name); if (slots.Length > 0) { buf.Append(" "); } for (int idx = 0; idx < slots.Length; idx++) { if (slots[idx].Value is BoundParam) { BoundParam bp = (BoundParam)slots[idx].Value; buf.Append("(" + slots[idx].Name + " ?" + bp.VariableName + ") "); } else { buf.Append("(" + slots[idx].Name + " " + ConversionUtils.formatSlot(slots[idx].Value) + ") "); } } // append the temporal attributes buf.Append("(" + TemporalFact_Fields.EXPIRATION + " " + expirationTime + ")"); buf.Append("(" + TemporalFact_Fields.SERVICE_TYPE + " " + serviceType + ")"); buf.Append("(" + TemporalFact_Fields.SOURCE + " " + sourceURL + ")"); buf.Append("(" + TemporalFact_Fields.VALIDITY + " " + validity + ") "); buf.Append(")"); return(buf.ToString()); }
/// <summary> Method will return the fact in a string format. /// </summary> /// <returns> /// /// </returns> public virtual String toFactString() { StringBuilder buf = new StringBuilder(); buf.Append("f-" + id + " (" + deftemplate.Name); if (slots.Length > 0) { buf.Append(" "); } for (int idx = 0; idx < slots.Length; idx++) { buf.Append("(" + slots[idx].Name + " " + ConversionUtils.formatSlot(slots[idx].Value) + ") "); } buf.Append(")"); return(buf.ToString()); }
public virtual String toPPString() { StringBuilder buf = new StringBuilder(); buf.Append("(" + deftemplate.Name); if (slots.Length > 0) { buf.Append(" "); } for (int idx = 0; idx < slots.Length; idx++) { if (slots[idx].Value is BoundParam) { BoundParam bp = (BoundParam)slots[idx].Value; buf.Append("(" + slots[idx].Name + " ?" + bp.VariableName + ") "); } else { buf.Append("(" + slots[idx].Name + " " + ConversionUtils.formatSlot(slots[idx].Value) + ") "); } } buf.Append(")"); return(buf.ToString()); }
/// <summary> Method returns the pretty printer formatted string of the node's /// condition. For now, the method just replaces the operator. It might /// be nice to replace the slot id with the slot name. /// </summary> /// <returns> /// /// </returns> public override String toPPString() { return("node-" + nodeID + "> slot(" + slot.Name + ") " + ConversionUtils.getPPOperator(operator_Renamed) + " " + ConversionUtils.formatSlot(slot.Value) + " - useCount=" + useCount); }