Q: Accessing lower level classes

I'm having trouble even phrasing this question, so please bear with me.
I have several classes in a hierarchy (5 levels deep). All have empty constructors and each has an addXXXX method to populate the required internal attributes. The addXXXX methods have very loooooong parameter lists.
I can't say that Class A extends Class B, because Class A actually references multiple Class Bs. Think of Class A like a table and Class B as the records in the table.
I guess what I'm asking is should class b have it's addXXXX defined with it's long parameter list and then in Class A have another method addClassBAttrs with a really long parameter list that does nothing but call array[i] = ClassB() and then array.addXXXX( really long param list)?
Does that make sense? I know that will work but it doesn't seem very OO (I'm not a new programmer, 15 years. I am new to Java and OO).
Just FYI, an example of my class hierarchy might look something like:
Class A
- Class B
-- Class D
-- Class C
--- Class D
-- Class C
--- Class D
--- Class D
- Class B
-- Class D
-- Class C
- Class B
- Class E
The rules are Class A is always Unique, always exists and only appears at level 1.
Class E always is optional, is unique if it exists and can only appear at level 2.
At least 1 Class B will always appear and will only appear at level 2.
At least 1 Class C will appear for each class B and will only appear at level 3.
Class D is optional and can appear at level 3, after a Class B or at level 4 after a Class C.
I just reread this and I hold out slim hopes for anyone making head or tails from it but I have to try.
I've searched tutorials and white papers but can't find anything that addresses this particular layout.
Thanks,
Lewis

Let's take a fictitional set of classes:
class C1 {
    int c1a;
    int c1b;
    int c1c;
    public C1( int c1a, int c1b, int c1c, ... ) {
        setC1a( c1a );
        setC1b( c1b );
        setC1c( c1c );
    public void setC1a( int c1a ) {this.c1a = c1a }
    ... other methods to set attributes
    public int getC1a() {return c1a};
    ... other accessor methods
class CN {
    code like C1 except all variables are cN, where N is some number
class B1 {
    C1 c1;
    C2 c2;
    public B1( C1 c1, C2 c2, ... ) {Code to set attributes}
    public void setC1( C1 c1 ) {this.c1 = c1}
    ... and so on
class BN {
    code like B1 except all variables are bN, where N is some number
and finally our A class
class A{
    B1 b1;
    b2 b2;
    public A( B1 b1, B2 b2, ... ) {Code to set attributes}
    public void setB1( B1 b1 ) {this.b1 = b1}
    ... and so on
}Note that you can create an instance of A by doing...
A a = new A(
    new B1(
        new C1( 0, 0, 0, ... ),
        new C2( 0, 0, 0, ... ),
    new B2( ... ),
    ...  )or you can do create one by doing
C1 c1 = new C1( 0, 0, 0, ... );
C2 c2 = new C2( 0, 0, 0, ... );
B1 b1 = new B1( c1, c2, ... )
B2 b2 = new B2( ... );
A a = new A( B1, B2, ... );

Similar Messages

  • Why don't lower level classes recognize symbols used in the .fla file?

    I'm trying to reorganize my code. I have a Paradox.as file, which is linked to a Paradox.fla file.  When I referenced symbols placed on the timeline in my Paradox.as file, my animation code works.  Then I decided to move the code lower down into the hierarchy.  In my Paradox.as file, I create new instances of the Character class.  The following is the folder hierarchy for the related files.  * denotes a folder, and tab denotes its contents:
    *Paradox 1-3
         Paradox.fla
         *code
              Paradox.as
              * Player
                   Character.as
    The symbol "player" is a Character type symbol on the Paradox.fla timeline, as are several other symbols.  Everything works just fine if I'm referencing these symbols in Paradox.as.  However, when I moved the code to Character.as (changing former references to Character type symbols in Paradox.as to "this" in Character.as), none of the symbols on the timeline are recognized any longer.  This is true of both Character type symbols and other types of symbols placed on the timeline.  Why?  Does Paradox.as recognize the symbols only because it is linked to Paradox.fla as the Document Class?  I even exported the Character symbol to Character.as...

    Oh.  Yeah.  The .as file linked to the .fla file works just fine.  What I was saying in my original post was, even though that part worked fine, when I transferred to a lower level class that was not linked to the .fla file but was instantiated in the .as file that was linked to the .fla file, I couldn't access anything on the stage directly.  What I ended up doing was passing the references to the lower level class.
    I can't find the checkbox where it says "Automatically declare stage instances", but fortunately for me it's enabled.  When calling a MovieClip that's on the stage, I only have to use its name in the .as file that's linked to the .fla file.

  • Error when accessing low level objects and converting variant to refnum Type

    Hope someone can give a clue....
    I'm using a dll, but it only has one creatable object, and I need to call two non-creatable objects.
    When the method to return the new reference is called, an error occured ("Member not found.
    in My.vi").
    The weird thing is that when I wired the new reference, I'm able to see the new methods and properties expected of the new object.
    Should I ignore this error???
    Also, does anyone know, How can I convert a variant to a ActiveX refnum??? because, when I use the To G type Lib, if a refnum type is wired, it's like this type is not supported, but the list states otherwise.
    Thank you in advance for any clue you can give me!!!

    Since I do not know what type of ActiveX object you are calling, I do not know about the error you are seeing. However, since everything seems to be working after that, I would assume it's okay. Now, you can convert a variant to an ActiveX refnum, but how you do this depends upon what type of refnum you need. Use the Variant to Data.vi to convert your variant type to a refnum by wiring in an ActiveX refnum to the "type" input. You will first need to determine what type of ActiveX refnum it is (Automation, Control, etc) and then wire that wire type into this VI.
    J.R. Allen

  • How can I get low level access to netstream using OSMF?

    Hi
    I'm trying to gain access to the low level netstream underneath the hood of OSMF so that I can access its netstream.info property for reading metrics.
    I find that I am able to do this for MP4 videos but not for F4M dynamic streaming videos.
    For MP4, I was successfully able to create a VideoElement that used a CustomNetLoader class which overrided the createNetStream method to return a netstream object.
    However, for F4M, I have to use either the MediaFactory.createMediaElement(element) method or the F4MElement. The F4MElement does not allow a CustomNetLoader to be used and it seems to only accept a F4MLoader class.
    Any advice on how I can access either the netstream object or the metrics of F4M videos?
    Thanks

    ok, I finally got access to the direct netstream object - someone from Akamai gave me the answer.
    Seeing how I wasn't able to find this answer anywhere on Google, I'm going to post the solution here as there's no way I would have known this solution without someone who knew how to get direct access to the netsteam object in OSMF.
    There's a hidden class that won't show up in the code hint called org.osmf.net.NetStreamLoadTrait that you have to import.
    1) First, your media player playing controlling your MediaElement has to listen for a LoadEvent.LOAD_STATE_CHANGE event after you load the MediaElement into the media player
    mediaPlayer.addEventListener(LoadEvent.LOAD_STATE_CHANGE, onLoadStateChange);
    2) Upon LoadEvent.LOAD_STATE_CHANGE, check for a org.osmf.traits.LoadState.READY - you can only access the NetStream object when it is LoadState.READY or the netstream object will return as null.
    private function onLoadStateChange(e:LoadEvent)
                                  if(e.loadState == LoadState.READY)
    3) Once the LoadState.READY is true, you can create a datatype of NetStreamLoadTrait and type cast it from a Load trait:
    private function onLoadStateChange(e:LoadEvent)
      if(e.loadState == LoadState.READY)
         var nsLoadTrait:NetStreamLoadTrait = mediaPlayer.media.getTrait(MediaTraitType.LOAD) as NetStreamLoadTrait;
    4) Once you successfully type cast the Media Load Trait from your media into NetStreamLoadTrait, you can access the property netstream from the NetStreamLoadTrait object.
    private function onLoadStateChange(e:LoadEvent)
      if(e.loadState == LoadState.READY)
         var nsLoadTrait:NetStreamLoadTrait = mediaPlayer.media.getTrait(MediaTraitType.LOAD) as NetStreamLoadTrait;
         var ns:NetStream = nsLoadTrait.netStream;
    Hope this helps someone out there.

  • How to disable Wifi and Network access in low level setting for security ?

    Hi
    New to here
    One of our final customer bought imac last months. OS 10.9, SN is c02*******J4i
    Since they are security printing, all the necessary ports accessing to outisdes need to be disabled in low level setting(not the ons just like turn on and off ).
    The ports including USB storage, Network and WIFI.
    I googled and found the following
    Open the /System/Library/Extensions folder.
    To remove support for USB mass storage devices, drag the following file to the Trash: IOUSBMassStorageClass.kext
    Open Terminal and enter the following command: $ sudo touch /System/Library/Extensions The touch command changes the modified date of the /System/Library/Extensions folder. When the folder has a new modified date, the Extension cache files (located in /System/Library/) are deleted and rebuilt by Mac OS X.
    Choose Finder > Secure Empty Trash to delete the file.
    Restart the system.
    I want to confirm this before sending to final user. Since I didn't have mac on hand, just wonder whether there are similar kext files for network and wifi to remove.
    Just like step 2 described.
    I would like customer to backup these files before permanently removed.
    Many thanks
    Kevin
    <Edited By Host>

    chiqui wrote:
    Is it possible to disable Internet access point and WAP as when I use WiFi some connections to WAP server of my provider are still made and I get charged. I am looking for the option not to delete it entirely from the access point list, but rather disable it as I might need connection when WiFi is not available and I want to be able to enable it as once I delete the server name and setting I won't know it.
    Is it possible to do it and how?
    You could delete WAP accesspoint. Not all providers (carriers) allow this.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • High performance (low level) jdbc access routines

    Does anyone know of any low level jdbc access routines?
    My need is to be able to do high speed data access. I'm looking for something 2 orders of magnitude faster than what is available with the typical use of java.sql (connection, preparedstatement, resultset and so on).
    Several years ago while using visual basic and odbc, I had to use direct calls to the odbc32.dll functions for data access to get the performance I wanted rather than the ado and rdo stuff. I am wondering what is available with jdbc - perhaps the routines that are used when writing jdbc drivers themselves. I don't know if there is an equivalent "gateway" that all jdbc drivers use (like the odbc32.dll that is used with all odbc drivers in windows)
    Any comments would be appreciated. Even just hints as to where I might find this kind of information.

    Does anyone know of any low level jdbc access routines? What are you expecting besides what is provided in the java.sql interfaces?
    The JDBC spec spells out what the interfaces are. There isn't anything else to call.
    >
    My need is to be able to do high speed data access.
    I'm looking for something 2 orders of magnitude
    faster than what is available with the typical use
    of java.sql (connection, preparedstatement, resultset
    and so on).Faster than what driver talking to what database over what network?
    Several years ago while using visual basic and odbc,
    I had to use direct calls to the odbc32.dll functions
    for data access to get the performance I wanted
    rather than the ado and rdo stuff. I am wondering
    what is available with jdbc - perhaps the routines
    that are used when writing jdbc drivers themselves.You'll have to write your own driver.
    I don't know if there is an equivalent "gateway"
    " that all jdbc drivers use (like the odbc32.dll that
    is used with all odbc drivers in windows)Since Java's platform-independent, there's no easy out like taking advantage of OS calls.
    Any comments would be appreciated. Even just hints
    as to where I might find this kind of information.Sounds to me like you want to write your own driver, and when you're done it will only be good for one database and operating system.
    I'd have to ask what made you so certain that database calls were the bottleneck in your app. For the typical Web app, a reasonably well written persistence layer will be fast enough. There's other network latency in the system, and UI response can be slow enough to keep up. Are you worried about high throughput to the database for a Web app? If so, you might be guilty of premature optimization.
    Unless I was absolutely certain that the JDBC driver from my database vendor would not do the job, I'd write the app and then profile it to find out where the performance bottlenecks were. I wouldn't take this extreme step until I was certain that the driver was the problem and a custom version would fix it.
    %

  • "Low-level" authorizations for accessing BW reports - add users to role

    Using the advice in Topic "Low-level" authorizations for accessing BW reports, I have been able to publish a query to a role that has 3 test users and each user gets the same query but with different data, as determined in the tables.
    Is there a way to look up the users and e-mail addresses from a table and associate them to the role? We have several hundred e-mail recipients that will not need BW access, but only need an e-mail with a static report that contains data on their own territories.

    Hi!
    i think programatically it might be complex. You got to maintain a seperate variant of report per user and use this variant to send mail. that means you need to maintain a variant and a Broadcast setting per user. once maintained you can use it any number of times the values will be recalculated everytime.
    with regards
    ashwin
    <i>PS n: Assigning point to the helpful answers is the way of saying thanks in SDN.  you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.</i>

  • Low level disk access using win API libraries

    Hello All,
    One of my project requires "low level access to the drives (usually pen Drive)' for analysis. I think this is possible using WIN API functions, i tried to read using kernal32.dll but i am unable to complete the task effectively, since i dont have sufficient exposure to text oriented languages. Basically i need to read the memory as it is stored, just like stream of bytes. Could any one guide me how do i proceed inorder to get rid of this.
    thank you.

    Unfortunately no. You cannot mix both high and low level on the same screen. You'll probably have to draw it out yourself and capture user input, unless you're willing to use textboxes.
    Or.. i suppose you can try using customItems for all your "coloring" instead?

  • Question about CHKDSK ,S.M.A.R.T and low level format

    hi,
    I like to know the difference     exactly  between CHKDSK and S.M.A.R.T and low level format program(I know that  low level format  writes zero"s) I mean besides the low level format writes  zero's what onother
    benefits it  has , it repairs some bad sectors or mark bad sectors ect?
    very short explanation wil be enough.
    thanks
    johan
    h.david

    H.david
    1-CHKDSK http://en.wikipedia.org/wiki/CHKDSK  CHKDSK verifies the
    file system integrity on
    hard disks or
    floppy disk and fixes logical file system errors.
    2-S.M.A.R.T http://en.wikipedia.org/wiki/S.M.A.R.T.  smart is a monitoring system for
    computer
    hard disk drives (HDDs) and
    solid-state drives (SSDs)<sup class="reference" id="cite_ref-1">[1]</sup> to detect and report on various indicators of reliability, in the hope of anticipating failures.
    3-Low level formatting  http://en.wikipedia.org/wiki/Low_level_format
    Wanikiya and Dyami--Team Zigzag

  • Concurrence of low level and semantic EventListener

    Hello,
    when in the following program [Cancel] is clicked right after program start, I don't mind that the low level FocusEvent is first processed. But I do wonder why
    the ActionListener is not processed at all.
    Only when [Cancel] is clicked a second time (meanwhile the caret is in the third textfield, where there is no FocusListener) the program exits.
    Removing the comment slashes in the focusLost method is a solution to this problem. However, I did not find anything concerning this topic in the documentation. Does anybody know a page where I can find a rule on which listener eats which?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Cancel extends JFrame
    { JTextField tf1, tf2, tf3;
      public Cancel()
      { setSize(300,300);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        Container cp= getContentPane();
        cp.setLayout(null);
        tf1 = new JTextField(20);
        tf1.setBounds(50,50,200,20);
        tf1.addFocusListener(new FocusAdapter()
        { public void focusLost(FocusEvent e)
          { // if (!(e.getOppositeComponent() instanceof JButton))
         tf3.requestFocus();
        tf2 = new JTextField(20);
        tf2.setBounds(50,100,200,20);
        tf3 = new JTextField(20);
        tf3.setBounds(50,150,200,20);
        JButton b = new JButton("Cancel");
        b.setBounds(100,200,100,30);
        b.addActionListener(new ActionListener()
        { public void actionPerformed(ActionEvent evt)
          { System.out.println("Cancel");
         System.exit(0);
        cp.add(tf1);
        cp.add(tf2);
        cp.add(tf3);
        cp.add(b);
        setVisible(true);
      public static void main(String arg[])
      { new Cancel();
    }Regards
    Joerg

    I think the process must be
    (1) Click on (above) Cancel
    (2) Current focus is moved
    (3) New focus is given
    (4) Component recieves click
    but in the code above there is
    (2.5) focus moved to Text field
    and this presumably cuts off the rest of the sequence. I'm not sure where in the depths of Swing this could be confirmed/refuted but since AbstractButton is only the reciever in this chain i'd doubt its there?
    maybe java.awt.EventDispatchThread? or some kind of FocusManager?
    the exact logic is probably distributed among lots of classes though :(
    Frankly, if this behaviour is intentional, I don't
    understand why.hm, if manually reassigning focus didn't take precedence to the user impliciting reassigning focus by clicking on components then it wouldn't have any point though (?)
    asjf

  • Low-Level or High-Level for GUI ?

    I am developing a MIDLet that has to run CLDC-1.1 MIDP-2.0 Devices. The MIDLet has a simple user interface, and there is no gaming. I developed the MIDLet using the high-level GUI class, but I discovered that this class is nice, yet limited. Now I am investigating using the low level canvas class for the GUI. Is it possible to maintain cross-platform compatibility with the canvas, or should I stick with the high-level class?

    High Level Group
    Classes provided are
         Perfect for development of MIDlets that target the maximum number of devices
         Heavily abstracted to provide minimal control over their look and feel
         Classes do not provide exact control over their display
    Low Level Group
    Classes provided are
         Perfect for MIDlets where we want precise control over the location and display of the UI elements
         If more control there is comes less portability It may not be deployable on certain devices
    Cheers,
    Rohan Chandane

  • To get lower level org units of any particular main org unit

    Hi All,
    I need to get all the lower level org units of any particular main org unit (the one maintained in ppoma_crm).
    Is there any FM/method to get this information?
    Cheers,
    Sharad

    Hi Sharad,
    The following code ought to work:
    CALL FUNCTION 'RH_STRUC_GET'
        EXPORTING
          act_otype              = 'O'
          act_objid              = <your main orgunit>
          act_wegid              = 'ORGEH'
        ACT_INT_FLAG           =
          act_plvar              = '01'
        ACT_BEGDA              = SY-DATUM
        ACT_ENDDA              = SY-DATUM
        ACT_TDEPTH             = 0
        ACT_TFLAG              = 'X'
        ACT_VFLAG              = 'X'
        AUTHORITY_CHECK        = 'X'
          text_buffer_fill       = 'X'
          buffer_mode            = 'X'
      IMPORTING
        ACT_PLVAR              =
        TABLES
        result_tab             =
          result_objec           = lt_result_objec
        RESULT_STRUC           =
        EXCEPTIONS
          no_plvar_found         = 1
          no_entry_found         = 2
          OTHERS                 = 3.
      IF sy-subrc = 2.
        RETURN.
      ENDIF.
      IF sy-subrc <> 0.
        RAISE error.
      ENDIF.
    I found this example in the below method,you can have a look as well.
    Class: CL_CRM_PPM_UM_TOOLKIT
    Method: GET_SUB_ORGUNITS
    Thanks,
    Sarat

  • Low-level USB control

    Hi all,
    I'm trying to do some very-low level USB control using Labview. Tasks are:
    -Write 1 to output
    -Write 0 to output
    -Write clock to output.
    Very simple tasks (no need to read, just write) , but i need to be able to do this with just a USB cable attached without any device. It will be used to characterize the cable.
    The other end of the cable will be terminated appropriately. 
    If anyone could give me some information for me to start this, that would be extremely helpful.

    If you want to do something like setting the pins of a RS-232 port without a device attached, this will not work.
    USB works fundamentally differently to RS-232.  It is a point-to-point connection.  It doesn't work open ended and you don't have direct access to the signal levels at all.
    Look for a cheap I/O device instead and use it for testing.
    Shane.
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • Low level interfaces to JVM

    Hi. I'm trying to write a java debugger in java. Sun mentions publicly available low level interfaces to the JVM for getting complete info on classes (ie things like private variables)
    see the end of http://java.sun.com/docs/books/vmspec/2nd-edition/html/Overview.doc.html
    I've been searching this site for "low level interface" but I haven't been able to find any information on this topic. Has anyone had any experience with this? Can anyone help me out?
    Thanks,
    Tom

    There are a number of free publicly available
    debuggers. You can get hold of their source for a
    few ideas. e.g. Eclipse, NetBeansThanks for this peter. I think you're missing the point though. I am trying to build my own debugger so that I can precisely control the environment, not to do typical debugging. Even using an open source project, I think it would take me longer to try to fit in what I want to do into that than to build my own.

  • Low Level VI for ELVIS

    Where can I get the low level VIs for ELVIS functionalities not currently exposed in LabView eg for Bode Analyzer, Arbitrary WaveForm Generator

     Hi Adnaan,
     The lower level VI's are just as you list: DMM, FGEN, etc. I'm sorry the Bode Analyzer low level's are not available.
     It looks like all of the controls for the BodeAnalyzer can be accessed from the block diagram, is this not the level of programatic control that you need?
     The Express VI link was included in case you we're interested in how to create these.
     Have a great weekend!
    Best regards,
    MatthewW
    Applications Engineer
    National Instruments
    Message Edited by Matthew W on 09-28-2007 06:36 PM
    Attachments:
    bode_elvis.JPG ‏11 KB

Maybe you are looking for

  • How do I print in color to my HP D110a from my MacBook Air (Maverick)

    I cannot print in color on my HP D110a printer from my new MacBook. I downloaded the drivers and it prints ok in black and white, but there are no options under System Preferences - Printers/Scanners to choose color or grayscale. Do not know where to

  • Ios 7.1 problems with iphone 4s

    Since I did the update to IOS 7.1 when I want to close down applications I try double clicking the home key so that I can swipe them closed, however it doesn't always work immediately.  My IPhone 4S is about 2 years old so not sure if it is the phone

  • Can I increase time before screen goes dark on iPhone 5?

    Can I increase the time before screen goes dark (to sleep) on iPhone5?

  • Problems loading certain websites

    I am having a problem loading several websites that I know are hosted on the same server. Three of these sites I have created. I am not able to load them using my iMac, iPad, or iPhone. The browser I am using is Safari and Mobile Safari. This issue h

  • What do i have to do to burn pic to a dvd

    help im trying to put some of my pic onto a DVD n when i hit burn it doesnt do anything