public Object clone() { HostPort retval = (HostPort) super.clone(); if (this.host != null) retval.host = (Host) this.host.clone(); return retval; }
/** Debug function */ public void dbgPrint() { super.dbgPrint(); }
/** * Formatter with a given starting indentation. */ public String debugDump(int indent) { indentation = indent; String retval = this.debugDump(); indentation = 0; return retval; }
} else if ( hisObj != null && GenericObject.isMySubclass(myObj.getClass()) && GenericObject.isMySubclass(hisObj.getClass()) && myObj.getClass().equals(hisObj.getClass()) && ((GenericObject) hisObj).getMatcher() != null) { String myObjEncoded = ((GenericObject) myObj).encode(); return ((GenericObject) hisObj).getMatcher().match( myObjEncoded); } else if ( GenericObject.isMySubclass(myObj.getClass()) && !((GenericObject) myObj).match(hisObj)) return false; else if (
if (myobj instanceof GenericObject) System.out.println("Trying to match = " + ((GenericObject) myobj).encode()); if (GenericObject.isMySubclass(myobj.getClass()) && ((GenericObject) myobj).match(hisobj)) break outer; else if (GenericObjectList.isMySubclass(myobj.getClass()) break outer; System.out.println(((GenericObject) hisobj).encode()); return false;
protected void sprint(String s) { super.sprint(s); }
/** * Put the encoded version of this object in the given StringBuilder. */ public StringBuilder encode(StringBuilder buffer) { return buffer.append(encode()); } }
stringRepresentation = ""; Class<?> myclass = getClass(); sprint(myclass.getName()); sprint("{"); Field[] fields = myclass.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { sprint(fieldName + ":"); try { sprint(fname + ":"); if (fname.compareTo("int") == 0) { int intfield = f.getInt(this); sprint(intfield); } else if (fname.compareTo("short") == 0) { short shortField = f.getShort(this); sprint(shortField); } else if (fname.compareTo("char") == 0) { char charField = f.getChar(this); sprint(charField); } else if (fname.compareTo("long") == 0) { long longField = f.getLong(this); sprint(longField); } else if (fname.compareTo("boolean") == 0) { boolean booleanField = f.getBoolean(this); sprint(booleanField); } else if (fname.compareTo("double") == 0) { double doubleField = f.getDouble(this); sprint(doubleField);
public StringBuilder encode(StringBuilder buffer) { if (name != null && value != null && !isFlagParameter) { if (GenericObject.isMySubclass(value.getClass())) { GenericObject gv = (GenericObject) value; buffer.append(name).append(separator).append(quotes); gv.encode(buffer); buffer.append(quotes); return buffer; if (GenericObject.isMySubclass(value.getClass())) { GenericObject gv = (GenericObject) value; gv.encode(buffer); return buffer; } else if (GenericObjectList.isMySubclass(value.getClass())) {
return false; } else if ( GenericObject.isMySubclass(myObj.getClass()) && !((GenericObject) myObj).match(hisObj)) return false; else if (
public void merge(Object mergeObject) { super.merge (mergeObject); if (port == -1) port = ((HostPort) mergeObject).port; }
/** * Add a new string to the accumulated string representation. */ protected void sprint(String a) { if (a == null) { stringRepresentation += getIndentation(); stringRepresentation += "<null>\n"; return; } if (a.compareTo("}") == 0 || a.compareTo("]") == 0) { indentation--; } stringRepresentation += getIndentation(); stringRepresentation += a; stringRepresentation += "\n"; if (a.compareTo("{") == 0 || a.compareTo("[") == 0) { indentation++; } }
return false; } else if ( GenericObject.isMySubclass(myObj.getClass()) && GenericObject.isMySubclass(hisObj.getClass()) && myObj.getClass().equals(hisObj.getClass()) && ((GenericObject) hisObj).getMatcher() != null) { String myObjEncoded = ((GenericObject) myObj).encode(); boolean retval = ((GenericObject) hisObj).getMatcher().match( myObjEncoded); if (!retval) return false; } else if ( GenericObject.isMySubclass(myObj.getClass()) && !((GenericObject) myObj).match(hisObj)) return false; else if (
/** * Pretty printing function accumulator for objects. */ protected void sprint(Object o) { sprint(o.toString()); }
/** * Get the parameter as a String. * * @return the parameter as a string. */ public String getParameter(String name) { Object val = this.getValue(name); if (val == null) return null; if (val instanceof GenericObject) return ((GenericObject) val).encode(); else return val.toString(); }
/** * Do a merge of the GenericObjects contained in this list with the * GenericObjects in the mergeList. Note that this does an inplace * modification of the given list. This does an object by object merge of * the given objects. * * @param mergeList * is the list of Generic objects that we want to do an object by * object merge with. Note that no new objects are added to this * list. * */ public void mergeObjects(GenericObjectList mergeList) { if (mergeList == null) return; Iterator it1 = this.listIterator(); Iterator it2 = mergeList.listIterator(); while (it1.hasNext()) { GenericObject outerObj = (GenericObject) it1.next(); while (it2.hasNext()) { Object innerObj = it2.next(); outerObj.merge(innerObj); } } }
} else if ( hisObj != null && GenericObject.isMySubclass(myObj.getClass()) && GenericObject.isMySubclass(hisObj.getClass()) && myObj.getClass().equals(hisObj.getClass()) && ((GenericObject) hisObj).getMatcher() != null) { String myObjEncoded = ((GenericObject) myObj).encode(); boolean retval = ((GenericObject) hisObj).getMatcher().match( myObjEncoded); if (!retval) return false; } else if ( GenericObject.isMySubclass(myObj.getClass()) && !((GenericObject) myObj).match(hisObj)) return false; else if (
/** * Pretty printing accumulator function for booleans */ protected void sprint(boolean booleanField) { sprint(String.valueOf(booleanField)); }
/** * Get the parameter as a String. * * @return the parameter as a string. */ public String getParameter(String name, boolean stripQuotes) { Object val = this.getValue(name, stripQuotes); if (val == null) return null; if (val instanceof GenericObject) return ((GenericObject) val).encode(); else return val.toString(); }
/** * Debug printing function. */ protected void dbgPrint() { Debug.println(debugDump()); }