<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Donghoon,<br>
      <br>
      In Java, the fully qualified classname must be unique.  There is
      some magic that can be done with different class loaders and such,
      but in general, and in Kepler and Ptolemy, the fully qualified
      classname will be unique.  The fully qualified classname includes
      the package,  So, ptolemy.actor.lib.StringConstant is one actor.  
      There can be another actor,
      ptolemy.actor.lib.mypackage.StringConstant.  Both actors could be
      used in a model.<br>
      <br>
      Note that Kepler has actor oriented classes (see
      <a class="moz-txt-link-freetext" href="http://ptolemy.eecs.berkeley.edu/publications/papers/07/classesandInheritance/index.htm">http://ptolemy.eecs.berkeley.edu/publications/papers/07/classesandInheritance/index.htm</a>). 
      The quick summary of actor oriented classes is that they are
      chunks of functionality implemented as Ptolemy models that can be
      reused by instantiation or subclassing.  The Sinewave actor is an
      actor-oriented class.  When you are calling
      parameter.getContainer().getClassName(), you are getting the
      className which may or may not be the same as the Java class name.<br>
      <br>
      Probably the method that is being called is in
      ptolemy/kernel/util/NamedObj.java:<br>
      <blockquote type="cite">   /** Return the MoML class name.  This
        is either
        the                                                            
         <br>
             *  class of which this object is an instance, or if
        this                                                        <br>
             *  object is itself a class, then the class that it
        extends.                                                    <br>
             *  By default, it will be the Java class name of this
        object.                                                   <br>
             *  This method never returns
        null.                                                                            
         <br>
             *  @return The MoML class
        name.                                                                               
         <br>
             *  @see
        MoMLExportable                                                                                        
         <br>
             *  @see
        #setClassName(String)                                                                                 
         <br>
             */<br>
            @Override<br>
            public String getClassName() {<br>
            if (_className == null) {<br>
                    _className = getClass().getName();<br>
                }<br>
        <br>
                return _className;<br>
            }<br>
      </blockquote>
      <br>
      _className is set when instantiating clones for actor-oriented
      classes.<br>
      <br>
      <br>
      To get the last part of the fully qualified classname, see the
      lastIndexOf() method in the java.lang.String class:
<a class="moz-txt-link-freetext" href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#lastIndexOf-int">https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#lastIndexOf-int</a>-<br>
      <br>
      However, I think you just want to call NamedObj.getName():  
      parameter.getContainer().getName() should do the trick.<br>
      <br>
      _Christopher<br>
      <br>
      On 11/17/14 9:47 AM, DONGHOON KIM wrote:<br>
    </div>
    <blockquote
cite="mid:CAHwMc7WHiJgtdPOzM0mb0MihTbEhQmRG5tD7LdPhVZfuR8=BOA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Dear Kepler folks, 
        <div><br>
        </div>
        <div>In ActorReference.pdf file, there are explanations of each
          actors.  I have questions for this reference.</div>
        <div>
          <ul>
            <li>I can see the class name next to an actor. For example,
              String Constant (ptolemy.actor.lib.StringConst). The class
              name must be unique (i.e., ptolemy.actor.lib.StringConst).
              If so, is the last classname unique? In other words,
              "StringConst" is also unique?</li>
            <li>I can see the value of "StringConst" in _container in
              parameter class. How can I just extract only last name
              "StringConst"? Actually, I have tried several ways in
              SQLRecording.java like below:</li>
            <ul>
              <li> System.out.println("3: " +
                parameter.getContainer().toplevel().toString());</li>
              <li> System.out.println("4: " +
                parameter.getContainer().getClassName());</li>
              <li> System.out.println("5: " + parameter.getContainer());</li>
            </ul>
          </ul>
        </div>
        <blockquote style="margin:0 0 0 40px;border:none;padding:0px">
          <div>The output is :</div>
        </blockquote>
        <div>
          <ul>
            <ul>
              <li>3: ptolemy.actor.TypedCompositeActor {.Unnamed1}</li>
              <li>4: ptolemy.actor.lib.StringConst</li>
              <li>5: ptolemy.actor.lib.StringConst
                {.Unnamed1.DonghoonConstant}</li>
            </ul>
          </ul>
          <div>Please, let me know </div>
          <div><br>
          </div>
          <div>Thank you </div>
          <div><br>
          </div>
          <div>-Donghoon</div>
        </div>
        <div>
          <div><br clear="all">
            <div><br>
            </div>
            -- <br>
            <div>Donghoon Kim<br>
              Dept of Computer Science<br>
              North Carolina State University<br>
              <br>
              <br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kepler-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kepler-dev@kepler-project.org">Kepler-dev@kepler-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev">http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Christopher Brooks, PMP                       University of California
Academic Program Manager & Software Engineer  US Mail: 337 Cory Hall
CHESS/iCyPhy/Ptolemy/TerraSwarm               Berkeley, CA 94720-1774
<a class="moz-txt-link-abbreviated" href="mailto:cxh@eecs.berkeley.edu">cxh@eecs.berkeley.edu</a>, 707.332.0670           (Office: 545Q Cory)
</pre>
  </body>
</html>