001/*
002 Copyright (c) 2006-2014 The Regents of the University of California.
003 All rights reserved.
004
005 Permission is hereby granted, without written agreement and without
006 license or royalty fees, to use, copy, modify, and distribute this
007 software and its documentation for any purpose, provided that the above
008 copyright notice and the following two paragraphs appear in all copies
009 of this software.
010
011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
015 SUCH DAMAGE.
016
017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
022 ENHANCEMENTS, OR MODIFICATIONS.
023 */
024
025package ptolemy.kernel.util.test;
026
027import java.lang.ref.WeakReference;
028import java.util.Iterator;
029import java.util.LinkedList;
030import java.util.List;
031
032import ptolemy.kernel.util.Attribute;
033import ptolemy.kernel.util.IllegalActionException;
034import ptolemy.kernel.util.Instantiable;
035import ptolemy.kernel.util.NameDuplicationException;
036import ptolemy.kernel.util.NamedObj;
037import ptolemy.kernel.util.Workspace;
038
039public class TestInstantiableNamedObj extends NamedObj implements Instantiable {
040
041    public TestInstantiableNamedObj() {
042        super();
043    }
044
045    public TestInstantiableNamedObj(String name) throws IllegalActionException {
046        super(name);
047    }
048
049    public TestInstantiableNamedObj(Workspace workspace) {
050        super(workspace);
051    }
052
053    public TestInstantiableNamedObj(Workspace workspace, String name)
054            throws IllegalActionException {
055        super(workspace, name);
056    }
057
058    @Override
059    public List getChildren() {
060        List results = new LinkedList();
061        Iterator attributes = attributeList().iterator();
062        while (attributes.hasNext()) {
063            Attribute attribute = (Attribute) attributes.next();
064            results.add(new WeakReference(attribute));
065        }
066        return results;
067    }
068
069    @Override
070    public Instantiable getParent() {
071        return null;
072    }
073
074    @Override
075    public Instantiable instantiate(NamedObj container, String name)
076            throws CloneNotSupportedException, IllegalActionException,
077            NameDuplicationException {
078        return null;
079    }
080
081    @Override
082    public boolean isClassDefinition() {
083        return false;
084    }
085
086}