Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * Conditions Of Use
  *
  * This software was developed by employees of the National Institute of
  * Standards and Technology (NIST), an agency of the Federal Government.
  * Pursuant to title 15 Untied States Code Section 105, works of NIST
  * employees are not subject to copyright protection in the United States
  * and are considered to be in the public domain.  As a result, a formal
  * license is not needed to use the software.
 *
 * This software is provided by NIST as a service and is expressly
 * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
 * AND DATA ACCURACY.  NIST does not warrant or make any representations
 * regarding the use of the software or the results thereof, including but
 * not limited to the correctness, accuracy, reliability or usefulness of
 * the software.
 *
 * Permission to use this software is contingent upon your acceptance
 * of the terms of this agreement
 *
 * .
 *
 */
Product of NIST/ITL Advanced Networking Technologies Division (ANTD). * /
 
 package gov.nist.javax.sdp.fields;
A list of SDP Fields.

Author(s):
M. Ranganathan
Version:
1.2
 
 
 public abstract class SDPFieldList extends SDPField {
     protected SDPObjectList sdpFields;
 
     public SDPFieldList() {
     }

    
Return a list iterator for the embedded field list.
 
     public ListIterator listIterator() {
         return .listIterator();
     }
 
     public SDPFieldList(String fieldName) {
         super(fieldName);
          = new SDPObjectList(fieldName);
     }
 
     public SDPFieldList(String fieldNameString classname) {
         super(fieldName);
          = new SDPObjectList(fieldNameclassname);
     }

    
add a SDP Field to the list of headers that we maintain.

Parameters:
h is the sdp field to add to our list.
 
     public void add(SDPField h) {
         .add(h);
     }
 
     public SDPObject first() {
         return (SDPObject.first();
     }
 
     public SDPObject next() {
         return (SDPObject.next();
     }

    
Encode into a canonical string.
 
     public String encode() {
         StringBuffer retval = new StringBuffer();
         ListIterator li = .listIterator();
         while (li.hasNext()) {
             SDPField sdphdr = (SDPFieldli.next();
             retval.append(sdphdr.encode());
         }
         return retval.toString();
     }
    
convert to a string representation (for printing).

Parameters:
indentation int to set
Returns:
String string representation of object (for printing).
 
     public String debugDump(int indentation) {
          = "";
        String indent = new Indentation(indentation).getIndentation();
        ;
        String className = this.getClass().getName();
        sprint(indent + className);
        sprint(indent + "{");
        sprint(indent + .debugDump(indentation));
        sprint(indent + "}");
        return ;
    }

    
convert to a string representation

Returns:
String
    public String debugDump() {
        return debugDump(0);
    }

    
Return a string representation.

Returns:
String representation.
    public String toString() {
        return encode();
    }

    
Equality checking predicate.

Parameters:
other is the other object to compare ourselves against.
    public boolean equals(Object other) {
        if (other == null ) return false;
        if (!this.getClass().equals(other.getClass()))
            return false;
        SDPFieldList that = (SDPFieldListother;
        if ( == null)
            return that.sdpFields == null;
        return this..equals(that.sdpFields);
    }

    
Do a template match of fields.

Parameters:
template is the template to match against.
    public boolean match(Object template) {
        if (template == null)
            return true;
        if (!template.getClass().equals(this.getClass()))
            return false;
        SDPFieldList other = (SDPFieldListtemplate;
        if ( == other.sdpFields)
            return true;
        else if ( == null)
            return false;
        return .match(other.sdpFields);
    }
    public Object clone() {
        SDPFieldList retval = (SDPFieldListsuper.clone();
        if (this. != null)
            retval.sdpFields = (SDPObjectListthis..clone();
        return retval;
    }
New to GrepCode? Check out our FAQ X