/** * Add an sdp object to this list. */ public void add(SDPObject s) { super.add(s); }
/** * Concatenate two compatible header lists, adding the argument either to * the beginning or the tail end of this list. A type check is done before * concatenation. * * @param <var> * topFlag </var> set to true to add items to top of list else * add them to the tail end of the list. */ protected void concatenate(GenericObjectList objList, boolean topFlag) { if (!topFlag) { this.addAll(objList); } else { // add given items to the top end of the list. this.addAll(0, objList); } }
/** * Append a given list to the end of this list. * @param otherList SIPObjectList to set */ public void concatenate(SIPObjectList otherList) { super.concatenate(otherList); }
/** * Convert this list of headers to a formatted string. */ public String debugDump() { stringRep = ""; Object obj = this.first(); if (obj == null) return "<null>"; sprint("listName:"); sprint(listName); sprint("{"); while (obj != null) { sprint("["); sprint(((GenericObject) obj).debugDump(this.indentation)); obj = next(); sprint("]"); } sprint("}"); return stringRep; }
return false; else if ( GenericObjectList.isMySubclass(myObj.getClass()) && !((GenericObjectList) myObj).match(hisObj)) return false;
return false; GenericObjectList that = (GenericObjectList) other; ListIterator hisIterator = that.listIterator(); outer: while (hisIterator.hasNext()) { Object hisobj = hisIterator.next(); Object myobj = null; ListIterator myIterator = this.listIterator(); while (myIterator.hasNext()) { myobj = myIterator.next(); && ((GenericObject) myobj).match(hisobj)) break outer; else if (GenericObjectList.isMySubclass(myobj.getClass()) && ((GenericObjectList) myobj).match(hisobj)) break outer;
/** * Convert this list of headers to a string (for printing) with an * indentation given. */ public String debugDump(int indent) { int save = indentation; indentation = indent; String retval = this.debugDump(); indentation = save; return retval; }
/** * Encode the list in semicolon separated form. * * @return an encoded string containing the objects in this list. * @since v1.0 */ public String encode() { if (this.isEmpty()) return ""; StringBuilder encoding = new StringBuilder(); ListIterator iterator = this.listIterator(); if (iterator.hasNext()) { while (true) { Object obj = iterator.next(); if (obj instanceof GenericObject) { GenericObject gobj = (GenericObject) obj; encoding.append(gobj.encode()); } else { encoding.append(obj.toString()); } if (iterator.hasNext()) encoding.append(Separators.SEMICOLON); else break; } } return encoding.toString(); }
buffer.append(quotes); return buffer; } else if (GenericObjectList.isMySubclass(value.getClass())) { GenericObjectList gvlist = (GenericObjectList) value; buffer.append(name).append(separator).append(gvlist.encode()); return buffer; } else if ( value.toString().length() == 0) { gv.encode(buffer); return buffer; } else if (GenericObjectList.isMySubclass(value.getClass())) { GenericObjectList gvlist = (GenericObjectList) value; buffer.append(gvlist.encode()); return buffer; } else {
/** returns the first element * @return GenericObject */ public GenericObject first() { return (NetObject) super.first(); }
/** * Alias for the encode function above. */ public String toString() { return this.encode(); }
/** * string formatting function. */ private void sprint(String s) { if (s == null) { stringRep += getIndentation(); stringRep += "<null>\n"; return; } if (s.compareTo("}") == 0 || s.compareTo("]") == 0) { indentation--; } stringRep += getIndentation(); stringRep += s; stringRep += "\n"; if (s.compareTo("{") == 0 || s.compareTo("[") == 0) { indentation++; } }
clone_obj = ((GenericObject) obj).clone(); else if (GenericObjectList.class.isAssignableFrom (c)) clone_obj = ((GenericObjectList) obj).clone(); else if (Cloneable.class.isAssignableFrom (c)) {
return false; else if ( GenericObjectList.isMySubclass(myObj.getClass()) && !((GenericObjectList) myObj).match(hisObj)) return false;
/** * Convert to a string given an indentation(for pretty printing). * @param indent int to set * @return String */ public String debugDump(int indent) { return super.debugDump(indent); }
/** * Get the first object of this list. * @return GenericObject */ public GenericObject first() { return (SIPObject) super.first(); }
return false; else if ( GenericObjectList.isMySubclass(myObj.getClass()) && !((GenericObjectList) myObj).match(hisObj)) return false;
/** * Convert to a string given an indentation(for pretty printing). * This is useful for debugging the system in lieu of a debugger. * * @param indent int to set * @return an indentation */ public String debugDump(int indent) { return super.debugDump(indent); }
/** * Concatenate two compatible header lists, adding the argument to the tail * end of this list. * * @param <var> * topFlag </var> set to true to add items to top of list */ protected void concatenate(GenericObjectList objList) { concatenate(objList, false); }
public GenericObject first() { return (SDPObject) super.first(); }