// Copyright 2000-2004, FreeHEP.

package hep.graphics.heprep1.ref;

import java.io.Serializable;
import java.util.Enumeration;
import java.util.Vector;

import hep.graphics.heprep1.*;


/**
 *
 * @author M.Donszelmann
 *
 * @version $Id: DefaultHepRepPrimitive.java,v 1.1 2004/07/18 08:19:47 duns Exp $
 */

public class DefaultHepRepPrimitive extends DefaultHepRepAttribute implements HepRepPrimitive, Serializable {
    public static final String cvsId = "$Id: DefaultHepRepPrimitive.java,v 1.1 2004/07/18 08:19:47 duns Exp $";

    private Vector points;

    public DefaultHepRepPrimitive(DefaultHepRepAttribute parent) {
        super(parent);
        parent.add(this);
    }
    
    public HepRepInstance getInstance() {
        return (HepRepInstance)getParent();
    }
    
    public void add(HepRepPoint node) {
        if (points == null) {
            points = new Vector();
        }
        
        points.addElement(node);
    }

    public Enumeration getPoints() {
        return (points == null) ? empty : points.elements();
    }
}

