Determining the subclass calling the superclass

Need help with following: If I call a super class method from a sub class, how can the super class (from within the called method) determine which subclass made the call?

Good suggestion, thanks:
class Base {
    public void f() {
        if (behaviourApplies()) {
           //optional code
    protected boolean behaviourApplies() {
        return false;
class DerivedA extends Base {
    protected boolean behaviourApplies() {
        return true;
}[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • [svn:fx-4.0.0] 13647: this should actually fix the build - call the modified main target to call the bundle task for osmf and actually make the call from frameworks /build.xml

    Revision: 13647
    Revision: 13647
    Author:   [email protected]
    Date:     2010-01-19 17:04:22 -0800 (Tue, 19 Jan 2010)
    Log Message:
    this should actually fix the build - call the modified main target to call the bundle task for osmf and actually make the call from frameworks/build.xml
    QE notes:
    Doc notes:
    Bugs:
    Reviewer:
    Tests run:
    Is noteworthy for integration:
    Modified Paths:
        flex/sdk/branches/4.0.0/frameworks/build.xml

    Hi Renuka,
    The model classes get generated under gen_cmi folder at the time of model import.
    As far I know, the Web Dynpro build operation also re-generates these classes if reqd.
    That is why I asked you to delete the gen_* folder content & do a Project Rebuild operation.
    Or you can delete the model & try importing it again.
    If the problem persists with the generated classes then there is an issue/bug with the generation & I would recommend to raise an OSS message (WD Java component)
    Kind Regards,
    Nitin

  • Missed calls - a missed call is shown on the screen when the phone is locked. I slide the icon an the phone calls the back to the missed number. The phone still show a missed no. It should clear the icon since I obviously noted the missed call. Any fixes?

    Ok, a wish for the next iOS release, just a small anoying thing.
    Scenario:
    I have a missed call, the screen is locked. The name of the caller shows up on the screen, I slide the phone icon and phone back.
    When I've ended the call there is still a notification of a missed call, i.e. the same missed call that I just called back. To clear the missed call red circle icon on the phone icon (in the unlocked state and the notification on the locked screen) I must open the missed call list. Then it clears.
    My wish is that the phone understands that it should clear that missed call after I returned the call since I have obviously noted it.
    -> Is this something apple will update or is there a setting that I could change?
    /Erik

    You have to return the call via the recent list or tap the red missed call entry in recent list otherwise even a hundred calls won't turn the balloon off.

  • How to identify which switch in the panel called the function?

    here i have some 192 switches and 192 leds corresponding to each switch,
    if a switch is on(say 10th) correspondingly led(10th) should glow.
    i want to use the same function for all switche led pairs.
    all i could do was to check for the on switch in a for loop and then set the particular led on, but i find it very inefficient way of doing it.
    int CVICALLBACK switchOnOff (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2) is the function.
    can i use any of these arguments to extract which switch(unique id for that switch) called the function so that i can switch corresponding led glow?
    Solved!
    Go to Solution.

    Looping through controls is indeed a inefficient way of doing what you want!
    With such a great number of controls, you could assign an appropriate callbackData to each of them when loading the panel. Next you could create an array of control IDs with all the LEDs and operate in the switch callback to turn on and off the corresponding led. A small example will be more clear:
    At panel load:
    int leds[200];
    SetCtrlAttribute (panelHandle, PANEL_SWITCH1, ATTR_CALLBACK_DATA, (void *)1); leds[1] = PANEL_LED1;
    SetCtrlAttribute (panelHandle, PANEL_SWITCH2, ATTR_CALLBACK_DATA, (void *)2); leds[2] = PANEL_LED2;
    SetCtrlAttribute (panelHandle, PANEL_SWITCH192, ATTR_CALLBACK_DATA, (void *)192); leds[192] = PANEL_LED192;
    In the switch callback:
    int CVICALLBACK switchOnOff (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    int sts;
    if (event != EVENT_COMMIT) return 0;
    // Get the status of the switch
    GetCtrlVal (panel, control, &sts);
    // Set the led to the proper status
    SetCtrlVal (panel, leds[(int)callbackData], sts);
    return 0;
    For this solution to work, leds[] array must be global so that it is available to the control callback.
    An additional improvement could be to modify the panel loading so that swithces and leds are created programmatically. You could have a single switch/led pair set in the UIR editor and next have a loop that duplicate the controls, sets callbackData and loads the array of led ids.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Call a VI that calls a SubvI, the SubVI calls the VI -- non recursive solution

    I need a example how I can call a VI a second time when i have called some SubVI's.
    The last SubVI can call the first SubVI or the main VI.
    How can I do this?
    My problem is that recursive solutions are not allowed in LabVIEW.
    Suche ein Beispiel, wie man sinnvoll ein VI, welches mehrere SubVI
    aufruft, welche dann am Ende eines Dialogs sämtliche eingegebenen
    Werte zusammengefasst wiederum in einem SubVI dargstellt.
    Falls die Eingaben widerrufen werden sollen, muss der Dialog erneut
    durchlaufen werden.
    Hierzu benötige ich einen Lösungsansatz, da rekursives aufrufen in LabVIEW
    verboten ist.
    Könnte man mit globalen Variablen etwas Sinnvolles gestalten?
    Für Beispiele wäre ich dankbar!

    You can do recursion if you call VIs dynamically. Look here for an example.
    Try to take over the world!

  • Finished with the lemon called the N97, what other...

    I was absolutely disgusted with the N97.  It was full of bugs, could never receive a signal even within 0.5 km of a mast.
    iplayer and Facebook constantly had errors and failed to load, the whole experience with the N97 was enough to force me back to baked bean cans and a piece of string.
    I have sat back, mulled it over and allowed myself a few weeks to calm down and rationalise the situation, but my feelings have not changed.  Why did Nokia release a phone with so many issues, Vodafone have been taking these phones back and cancelling contracts at an alarming rate.
    I have had several Nokias in the past along with Sony E's.  So I don't want to tar the whole Nokia range due to a duff Lemon called the N97.
    What other options do I have to get a decent smartphone without going to the iPhone ?

    I upgraded to V11 but returned the phone a few weeks ago. I was told no firmware upgrade was going to sort out the reception issue and I'm fed up being a consumer tester for unfinished products and paying at the same time.
    Imagine buying a new car and finding the brakes dont work, only to be told an upgrade will sort it out. 
    I want to get back onto o2, I found Vodafone was a very poor service when you had issues. In all the years I was with o2 they were nothing but excellent.
    I need one that comes with the contract if possible, so that would rule out buying a vanilla model from nokia.
    I might go back to the brick I had in the mid 90's, al least it went ring ring and you could speak to someone on it

  • How does the interclass call the outerclass's method?

    Compile the following code,
    public class q extends JFrame
    class c2 implements ActionListener{
    public void actionPerformed(ActionEvent e7){
    System.out.println(q.getTitle());
    Get the errors:
    non-static method getTitle() cannot be referenced from a static context
    System.out.println(q.getTitle());
    What can I do next step?
    Thanks.

    Accessing outer class
    public class q extends JFrame
        class c2 implements ActionListener{
            Object outerClass;
            // constructor
            public c2(Object o) {
                 outerClass = o;
            public void actionPerformed(ActionEvent e7){
                System.out.println(((q) outerClass).getTitle());
    } example to create an instance of c2:
    c2 c = new c2(this);

  • TS1424 I purchased the series "Call the Midwife" and downloaded it to my Windows desktop. Then I tried to sync the episodes to my 1st generation iPad and an error message told me that the video format was incompatable with the my iPad. What to do?

    After downloading into my computer, I tried syncing to my iPad but to no avail. The purchased tv series would not sync. So then I tried to download via wifi directly to my iPad and the first two episodes downloaded no problem. The following 6 episodes then said that the video format was not compatible with my iPad and therefore would not download.  What should I do. I don't even know who to ask in Apple nor how to get in touch without paying a fee.

    Hi, jjsylves.
    Thank you for visiting Apple Support Communities. 
    If the media is still located on your computer, I would create a version specifically for the iPad.  To create and iPad version in iTunes 11 select the media that you are wanting to convert.  From there, select the File menu > Create New Version > Create iPad or Apple TV version.  Once the media has been converted, sync the iPad version to the iPad. 
    iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
    http://support.apple.com/kb/TS1497
    iTunes 11 for Windows: Syncing overview
    http://support.apple.com/kb/PH12311
    Regards,
    Jason H. 

  • Error while calling a super class public method in the subclass constructor

    Hi ,
    I have code like this:
    CLASS gacl_applog DEFINITION ABSTRACT.
      PUBLIC SECTION.
        METHODS:
                create_new_a
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXPORTING  pfx_log_hndl TYPE balloghndl
                   EXCEPTIONS error
    ENDCLASS.
    CLASS gacl_applog IMPLEMENTATION.
      METHOD create_new_a.
        DATA: ls_log TYPE bal_s_log.
      Header aufsetzen
        MOVE pf_extnumber TO ls_log-extnumber.
        ls_log-object     = pf_obj.
        ls_log-subobject  = pf_subobj.
        ls_log-aluser     = sy-uname.
        ls_log-alprog     = sy-repid.
        ls_log-aldate     = sy-datum.
        ls_log-altime     = sy-uzeit.
        ls_log-aldate_del = ls_log-aldate + 1.
        CALL FUNCTION 'BAL_LOG_CREATE'
             EXPORTING
                  i_s_log      = ls_log
             IMPORTING
                  e_log_handle = pfx_log_hndl
             EXCEPTIONS
                  OTHERS       = 1.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID      sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    CLASS gcl_applog_temp DEFINITION INHERITING FROM gacl_applog.
      PUBLIC SECTION.
        DATA: log_hndl   TYPE balloghndl READ-ONLY
            , t_log_hndl TYPE bal_t_logh READ-ONLY
        METHODS: constructor
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXCEPTIONS error
               , msg_add      REDEFINITION
               , display      REDEFINITION
    ENDCLASS.
    CLASS gcl_applog_temp IMPLEMENTATION.
      METHOD constructor.
        CALL METHOD create_new_a
               EXPORTING  pf_obj       = pf_obj
                          pf_subobj    = pf_subobj
                          pf_extnumber = pf_extnumber
               IMPORTING  pfx_log_hndl = log_hndl.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    A public method of Super class has been called from the constructor of the sub class. we are getting the syntax error :
    ' In the constructor method, you can only access instance attributes, instance methods, or "ME" after calling the constructor of the superclass…'
    Can you please suggest how to change the code with out affecting the functioanlity.
    Thank you ,
    Lakshmi.

    Hi,
    Call that method by instance of Subclass.   OR
    SUPER-->method.
    Read very useful document
    Constructors
    Constructors are special methods that cannot be called using CALL METHOD. Instead, they are called automatically by the system to set the starting state of a new object or class. There are two types of constructors - instance constructors and static constructors. Constructors are methods with a predefined name. To use them, you must declare them explicitly in the class.
    The instance constructor of a class is the predefined instance method CONSTRUCTOR. You declare it in the public section as follows:
    METHODS CONSTRUCTOR
            IMPORTING.. [VALUE(]<ii>[)] TYPE type [OPTIONAL]..
            EXCEPTIONS.. <ei>.
    and implement it in the implementation section like any other method. The system calls the instance constructor once for each instance of the class, directly after the object has been created in the CREATE OBJECT statement. You can pass the input parameters of the instance constructor and handle its exceptions using the EXPORTING and EXCEPTIONS additions in the CREATE OBJECT statement.
    The static constructor of a class is the predefined static method CLASS_CONSTRUCTOR. You declare it in the public section as follows:
    CLASS-METHODS CLASS_CONSTRUCTOR.
    and implement it in the implementation section like any other method. The static constructor has no parameters. The system calls the static constructor once for each class, before the class is accessed for the first time. The static constructor cannot therefore access the components of its own class.
    Pls. reward if useful....

  • The URL to call the screen of RFx directly

    Dear expart.
    I'm setteing at SRM7.0 in order to call RFx directly from SUS now.
    I would like to know what URL should be sat at URL of BIDDING_SERVICE in CustomerSetting of SUS.
    Should I set URL of EP there?
    Should I set URL of ITS as well as SRM5.0?
    Because ITS have not been used since SRM7.0, I have no Idea how to set.
    SO could you please let me know if you know the URL calling the screen of RFX directly.
    Thanks

    Hello ,
    Please use the url to launch the RFQ BO directly.
    HTTP://<Server and Port>/sap/bc/webdynpro/sapsrm/wda_l_fpm_oif?
    sap-wd-configId=/SAPSRM/WDAC_I_FPM_OIF_RFQ_PR_PU
    &sap-system-login-basic_auth=X
    &sap-client=<client_no>
    &sap-language=EN
    &SAPSRM_BOID=<Object Guid>
    &SAPSRM_BOTYPE=BUS2200
    &SAPSRM_MODE=DISPLAY
    Let me know if you have any further issues.
    Best Regards.
    Mani

  • I want thunderbird to run in the background when i call the default email client

    I have software that sends emails out for reports. The software calls the default mail client (Thunderbird) and sends the email. However this opens Thunderbird and gets in the way. Is there anyway that this could send the email without opening Thunderbird? Can it run in the background like outlook express? It needs to close after email is sent.

    Try with "Minimize to Tray" Add-ons
    *https://addons.mozilla.org/en-US/thunderbird/search/?q=minimize+to+tray

  • Creating class and returning the dataset when the proxy function is called

    Hello all,
    I am able to set the connection and call the function from .net. My requirement is all follow,
    I want to create a class in .net which will call this function and will return a dataset.
    That means when that class is called with the required parameter it should return a dataset.
    Can anyone can give the code or the steps how can i achieve it?

    You can either have an instance variable SoSession, if your seConnect() method is in the same class as the saveInterest() method, or pass in the SoSession object to the saveInterest() method.
    public class Sample{
        private SoSession session;
        public SoSession seConnect()
                SOApplication app = new SOApplication();
                SoSession se = SoSession.Authenticate(app.Database.Username, app.Database.Username);
                return se;
    public void saveInterest2()
                if (se != null) //Here i want to check on the returned se, but this is probably the wrong way ??, because it fails
                    System.out.println("Yeah' im still inn");
                else
                    System.out.println("Doo' im not  inn");
    } this way, the class calling the methods would do this:
    public class Test {
    public static void main(String [] args)
        Sample s = new Sample();
       s.seConnect();
       s.saveInterest();
    }~Tim
    Message was edited by:
    SomeoneElse

  • Outbound Dialer calls the client but don't call the agent

    Hi all,
    I have a strange problem with Outbound Option in UCCE 7.5(6).
    I have configured "PREVIEW_ONLY" in admin script. The behavior is below:
    - the campain starts;
    - I can see the call in "CTI Toolkit outbound desktop"(here I don;t see any call to agent's phone);
    - I am pressing "Accept";
    - The system calls the client;
    - The "client" answers the call;
    - I don't have any call to agent's phone.
    What could be the problem here?I verified the VIP's CSS. The dialer ports can dial in the agent's partition.
    Many thanks in advance,
    Cristian
    P.S: Call tracer output is below.(I have only one agent in outboud skill group with extension 1270)
    > DialedNumber (8000) using CallType (Outbound.CT- 5000)
    Start #1
         Default\OutboundScript {All Customers} (version 1)
    Select #2
         Longest Available Agent
        *PG1_CCM_PIM1.CV.Outbound.SG = 201
    Skill Group #4
         SkillGroup: PG1_CCM_PIM1.CV.Outbound.SG
    > ----------
    Route: Outbound.ROUTE
    Label: 1270 (MR_PIM1.RC)

    Update with baDialer EMS logging:
    :41:12 Trace: (SP) port: 005  Successfully sent Station Open Receive ACK Msg - PT: 4
    :41:12 Trace: (SP) port: 005  Received Station Call Info Msg. line=1  crn=26601631
    :41:12 Trace: (CLMGR_IP)      Control failure event, port: 005, id: 17170537, failure code: 1 [CF_GENERIC_OPERATION], peripheral error code: 20052 [C_??CAUSE??]
    :41:12 Trace: (PVD)   CTI failure received, port: 005 state: TRANSFER
    :41:12 Trace: (CUST)  SetCallResult, id: 47 in DL_5000_5000, skill: 5001, result: 21 [CUSTOMER_ABANDONED], now: [Fri Dec 04 14:41:12 2009], callback: [Fri Dec 04 14:40:55 2009]
    :41:12 Trace: (CLMGR) CTI SetCallData request, invoke: 5730, port: 005, call: 17170537
          type: 32, disposition: 2, ani: [1277]
          campaign: 5000 [OutboundCampaign], query rule: 5000, acc#: []
          status: [CO], response: [CPA_Voice], list id: [47], time zone: [+00120]
          CallerEnteredDigits: [NULL], customer name: [Popescu,Cristi], skill target id:
    :41:12 Trace: (PVD)   ***End call event port: 005, state: TRANSFER***
    :41:12 Trace: (PVR)   Release agent request, port: 004, state: AGENT_RESERVE
    :41:12 Trace: (PVR)   End port: 004
    :41:12 Trace: (CLMGR) CTI ClearConnection request, invoke: 5731, port: 004, call: 2130706445, instrument: [1270]
    :41:12 Trace: CCallManager::RemoveCall -> call: 2130706445
    :41:12 Trace: (PM)
    lease port: 004, state: [AGENT_RESERVE]
    :41:12 Trace: (CPORT) SetState, port: 004, m_ReservationCallTime: 16656, state: IDLE
    :41:12 Trace: (SP)    Hangup, port: 005
    :41:12 Trace: (PM)
    lease port: 005, state: [TRANSFER]
    :41:12 Trace: (SP)    Hangup, port: 005
    :41:12 Trace: (CPORT) SetState, port: 005, m_CustomerCallTime: 1687, state: IDLE
    :41:12 Trace: (SP) Port: 005 Changing state from SP_STATE_TRANSFERRING_CALL to SP_STATE_DROPPING_LINE2
    :41:12 Trace: (CM)    Close record request, customer: 47 in DL_5000_5000, result: 21 [CUSTOMER_ABANDONED]
    :41:12 Trace: (SP) Ignoring repeat hangup request on port: 005
    :41:12 Trace: (CUST)  Record sent to campaign manager, id: 47 in DL_5000_5000, skill: 5001, result: 21 [CUSTOMER_ABANDONED]
    :41:12 Trace: (SP) port: 005  Received Station Stop Tone Msg
    :41:12 Trace: (SP) port: 005  Received Station Close Receive Msg
    :41:12 Trace: (SP) port: 005  Received Receive Call State Msg - callstate=On Hook, CRN=26601631
    :41:12 Trace: (SP) port: 005  Primary line hangup
    :41:12 Trace: (SP) Line: 1: Changing state from SP_LINESTATE_CONNECTED to SP_LINESTATE_IDLE
    :41:12 Trace: (SP) port: 005 Fire telephony hangup event
    :41:12 Trace: (SP) Port: 005 Changing state from SP_STATE_DROPPING_LINE2 to SP_STATE_TRANSFER_FAIL
    :41:12 Trace: (SP) Port: 005 Changing state from SP_STATE_TRANSFER_FAIL to SP_STATE_DROPPING_LINE2
    :41:12 Trace: (DD)    Softphone hangup handled for port: 005
    :41:12 Trace: (CLMGR) Call cleared, port: 005, id: 17170537

  • Triggers that call the list of value

    How can I create the triggers that when I press the button call the Display List of my item??
    Regards
    Basilisco Giorgio

    You have to set LOVBUT generator preference to Y ("Generating list of values indicator buttons" topic in the on-line help) and forms generator will do all what is necessary. Of course there must be an associated list of values on an item.
    Helena

  • How to add a column to a list created with the Dynamic List Wizard to display the values of the fiel

    Hi,
    ADDT, Vista, WAMP5.0
    We have 2 tables: clients_cli (id_cli, name_cli, tel_cli, and several more fields) and cases_cas (id_cas, idcli_cas, court_cas, and a lot of other fields).
    Clients may have many cases, so table cases_cas have a foreign key named idcli_cas, just to determine which case belongs to which client.
    We designed the lists of the two tables with the Dynamic List Wizard and the corresponding forms with Dynamic Form Wizard.
    These two forms are linked with the Convert Dynamic List and Form Wizards, which added a button to clients list named "add case".
    We add a client and then the system returns to the clients list displaying all clients, we look for the new client just added and then press "add case", which opens the Dynamic Form for cases, enter all case details and everything processes ok.
    However, when we view the cases list it display all the details of the case, including the column and values for the foreign key idcli_cas. As you can image, it is quite difficult for a human to remember the clients ids.
    So, in the cases list we added a another column, named it Name, to display the names of the clients along with cases details. We also created another recordset rsCli, selected the clients_cli table, displaying all columns, set filter id_cli = Form Variable = idcli_cas then press the Test button and everything displays perfect. Press ok.
    Then, we position the cursor inside the corresponding cell of the new Name column, go to Bindings, click on name_cli and then click on insert. The dynamic field is inserted into the table cell as expected, Save the page, and test in browser.
    The browser call the cases list but fails to display the values of the Name column. The Name column is simply empty.
    This issue creates a huge problem that makes our application too difficult to use.
    What are we doing wrong?
    Please help.
    Charles

    1.     Start transaction PM01, Create Infotype, by entering the transaction code.
    You access the Create Infotype screen.
    2.     Choose List Screen.
    3.     In the Infotype no. field, enter the four-digit number of the infotype you want to create.
    When you specify the infotype number, please remember to enter any leading zeros.
    4.     In the Screen Number field, enter the screen number of the list screen you want to enhance.
    5.     Choose Create.
    The Dictionary: Initial screen appears:
    6.     Create the list screen structure.
    7.     Choose Activate.
    8.     Return to the Enhance List Screen in the Enhance Infotypes transaction (PM01).
    9.     Choose Create All.
    The additional fields are displayed on the list screen, however, they contain no data.
    The fields can be filled in the FORM routine FILL-LISTSTRUCT in the generated program ZPnnnn00. The FORM routine is called for each data record in the list.
    Structure ZPLIS is identified when it is generated with a TABLES statement in the program ZPnnnn00.
    The fields can be filled from the Pnnnn structure or by reading text tables.

Maybe you are looking for

  • Phantom DVD files (?!?)

    O.k., I'm working on converting avis to DVD, recently created a project and tried to check it with DVD player. It said could not open due to files not supported. Trashed project by deleting files and emptying my trash. Chalked it up to corrupt avi's.

  • How do I see a reply to my question

    can not find the answers to any questions,only questions, where are the answers?How do I bring them up to read? This question was solved. View Solution.

  • Aperture 3 Places - does it include altitude

    My question(s): Does the geotagged information in Aperture 3 get placed into the metadate in the image file, and does this data include altitude? I've been using third party apps with the previous version of Aperture to geotag my photo's. I was quite

  • Sustain pedal not working in Mainstage only with Kontakt 4 plugin

    I can't get Kontakt 4.0.2 to sustain notes when instantiated in Mainstage. The sustain pedal works fine for Kontakt in stand alone mode, and for the same patch/channel strip in Logic 9, but not when in a channel strip in MainStage. I have the pedal m

  • List-output after pressing button on Dynpro

    Hello, I have a dynpro with an alv grid and a button on the top. I need to print a text after pressing the button. I tried to do that by using WRITE, but nothing was shown. Can I show a textarea on another dynpro? How would You do that? Regards, Mich