Package com.bbn.openmap.vpfservlet

Source Code of com.bbn.openmap.vpfservlet.PlainRowMaker

// **********************************************************************
// <copyright>
//  BBN Technologies
//  10 Moulton Street
//  Cambridge, MA 02138
//  (617) 873-8000
//
//  Copyright (C) BBNT Solutions LLC. All rights reserved.
// </copyright>
// **********************************************************************
// $Source: /cvs/distapps/openmap/src/vpfservlet/WEB-INF/src/com/bbn/openmap/vpfservlet/PlainRowMaker.java,v $
// $Revision: 1.2.2.2 $ $Date: 2005/08/11 21:03:10 $ $Author: dietrick $
// **********************************************************************
package com.bbn.openmap.vpfservlet;

import java.util.Iterator;
import java.util.List;

import com.bbn.openmap.layer.util.html.TableRowElement;

/**
* A basic RowMaker that makes rows.
*/
public class PlainRowMaker implements RowMaker {

    /**
     * A basic constructor that doesn't do anything special.
     */
    public PlainRowMaker() {}

    /**
     * Generates a TableRowElement from a table by creating a new
     * TableRow and passing it and the list to addToRow, then
     * returning the new row.
     *
     * @param l the VPF table row
     * @return a HTML representation of the VPF row
     */
    public TableRowElement generateRow(List l) {
        TableRowElement tr = new TableRowElement();
        addToRow(tr, l);
        return tr;
    }

    /**
     * Adds the elements of the list to the table row
     *
     * @param row the HTML row
     * @param l the VPF row
     */
    public void addToRow(TableRowElement row, List l) {
        for (Iterator li = l.iterator(); li.hasNext();) {
            row.addElement(li.next().toString());
        }
    }

    /**
     * An empty implementation, since this class doesn't hold any
     * resources.
     */
    public void close() {}
}
TOP

Related Classes of com.bbn.openmap.vpfservlet.PlainRowMaker

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.