Adding objects to other objects

I would like to add a object to another object, Also, can i throw strings into a stack??
Cobbweb

Im mean kind of like this ....
Objects bum = tok.nextElement();
while(tok.hasMoreTokens())
bum+=tok.nextElement();
}Now that code doesnt work, but thats kind of what i
i wanna do......Well, you have to be a little more explicit about what you're actually trying to accomplish.
You can write a method add() on your class that does whatever you need it to, but you can't just stick a bunch of arbitrary objects together.
Depending on what you're trying to do, a List or something might be what you're looking for.
http://java.sun.com/docs/books/tutorial/collections/
>
Now that i know you can put a string into a stack, i
might now have to do that anymore... still if you
know hehe would be nice to know That depends on what that Stack class' public interface looks like. It might be stack.push(str) or stack.add(str) or something like that.

Similar Messages

  • Sharing an object between other objects?

    I have two classes, say DisplayPanel and ControlPanel. Both of these classes need to have access to a single instance of an object of type Data, say theData. I want to be able to set theData to a new object at any time, for example, theData = new KindOfData().
    If I store a reference to theData in both objects, when I set theData to a new object in one class, the other will still reference the old object. Is there a way to share an object between two classes as I described?
    I could create a superclass for DisplayPanel and ControlPanel that contains an instance of Data, however I may need to access this object in other classes and do not want to have the inflexibility of having to extend a possibly unrelated class just to access a single data member.
    Is there any easy way to go about this? Thanks for your help.

    Create a listener interface. Make each class implement that interface. When you create each class, register it as a listener to theData. Keep track of all listeners in a List such as an ArrayList. When you want to change theData, iterate through the List and call the interface's method to update theData in each class:
    public interface SomeListener
       void updateData(KindOfData theData);
    public class DisplayPanel implements SomeListener
      private KindOfData theData;
      public void updateData(KindOfData newData)
         theData = newData;
    public class SomeOtherClass
       private List listenerList = new ArrayList();
       public void addDataListener(SomeListener listener)
            listenerList.add(listener);
       public void fireDataChange(KindOfData newData)
           for (Iterator listenerIter = listenerList.iterator();
                  listenerIter.hasNext();
               ((DataListener)listenerIter.next()).updateData(newData);
    }Look at how EventListeners are added and fired in Swing classes.

  • How to organize Data Objects and other Objects in SWCV

    Hi,
    I am looking for Best Practices on how to organize data objects in SWCV as well as other objects such as a Distribution Rules.
    We are planning to develop three occasionally connected applications with NW Mobile 7.1 this year and maybe additional one the following year. We will create multiple Standard Data Objects (e.g. Plant, Company Code, Reservations, ...) which are shared in the first set of transactions and in the future transactions.
    I have heard before to separate out Standard Data Objects from Distribution Models and have two different SWCV.
    Should I have a) one SWCV for all current and future Standard Data Objects and one for the distribution rtules or b) should I separate out common data objects into one SWCV, and all transaction-specific data object each into separate SWCV?
    Just wondering if there are any best practices available for this so that I won't run into problems in the future when we want to add more transactions/data objects?
    Any advise is appreciated.
    Thanks,
    W. Berger

    Hi Siva,
    Thanks for quick reply!!
    I have created say SWCV1 for Dataobjects.
    Now i want to create seperate SWCV2 for defining distribution model.
    How i should proceed..I cannot see the uses option while creating new SWCV2  ( Only option i see is  'backward compatibility checkbox : uses NW04/NW04s MI Application')
    where to check the following which you have mentioned?
    SWCV2 was created and inherited SWCV1 in uses tab of SWCV2.
    Thanks in advance!!
    Regards
    Devendra

  • As3 get position from object in other object

    please i need help, i have a object inside this object i have other objects, (MC.Part1,MC.Part2,MC.Part3...etc), the MC rotate in the escene, that with interpolation, with the tools of flash,that is ok, the object parent rotate and the childs with he, but i want obtain the coordenate from the childs (MC1.Part1.x, MC1.Part1.y,MC1.Part1.z, etc), i try with trace(MC1.Part1.x), and always give me the same coordenate, i think is the coordenate in the parent, but i want the coordinate of the child when the parend is rotating.
    Please help me

    The coordinates of the child objects do not change relative to the parent that holds them if the parent is being moved, so they will report the same values all of the time.  If you want to know the location relative to the main stage, then you need to make use of the localToGlobal() method.  Try searching Google using terms like "AS3 localToGlobal tutorial" to get an explanation of how to use it.

  • Finding locations and adding annotations to other objects using maps.

    How can I display all the X things on a map view in an iPhone app?
    Say that I am making an app for viewing all the bars near a person's location.
    (The app is an iPhone app built using the xCode)
    How can I make the default map view zoomed on the user's location?
    And HOW can I make it show annotations for all the bars in the shown area?

    youd be better off posting this on the developers forum we are just regular users here

  • Accessing stage objects from other objects

    I have drawn colored rods which I have placed in the library and have put one of each on the stage with instance names like
    blueRod_mc, etc.
    I place them around with time-line code like
    blueRod_mc.x = 300.0;
    I have now created an Actionscript class called Problem.
    I build a new object from Problem which I have called Riddle.
    But when I put blueRod_mc.x = 300.0 in a method (of Problem),
    I get the message that blueRod is not accessible.
    So I tried
    stage.blueRod_mc.x = 300.0;
    That did not work either.
    What does work? How can I modify properties of stage objects like blueRod from
    within an AC3 object like Riddle?

    public class Problem {
      private var number1:String ="";
      private var number2:String ="";
      private var rigor:Number = 1;
         // rigor: -1 is 3 steps, -2 is 4-5 steps, -3 is 6-7 steps
      private var step:Number = 1;
      private var numSteps:Number = 3;
      private var solving:Number = 0;
      private var true1Length:Number;
      private var true2Length:Number;
      private var tuple = new Array(6);
      public function Problem():void  {
       // constructor code
       var i:Number;
       var j:Number;
       for (i = 0; i < 6; i++) {
                     tuple[i] = new Array(3+5);
                     for (j=0; j < 3; j++) {
                       tuple[i][j] = new Array(8+7);
       buildIt();
       planIt();
    Just insert bolded code where you need to.

  • Selecting objects when other objects overlap them?

    I have some objects that overlap one another. I am trying to select one of the objects in the foreground, though it keeps selecting the object in the background and vice versa. Is there an easy way to do this?
    Thanks.

    If you use CS5, there is a select-thru by holding down Ctrl while using any of the select tools. in older versions indeed selecting the layers first and locking the ones you don't want is the safest way.
    Mylenium

  • Drag and drop object in other object

    Greetings!
    I'm asking myself this question:
    I have this graph in my application and a panel.
    The graph is draggable. How can I drag and drop the graph
    into the panel so that the graph becomes a child of the panel?
    Thanks!

    Jeff Bohrer wrote:
    smercurio_fc wrote:
    Unlike your other annoyance, this one definitely always annoys me.
    Note: The LabVIEW project explorer window isn't the only IDE that does this. Visual Studio does the same thing when you drag and drop a file onto the Solution Explorer window and the target is a folder. So, the behavior is not unique to LabVIEW.
    Thought this would be today!  Thank YOU
    You're quire welcome. I do it all for you.
    X wrote
    CAR anyone?
    I don't think this needs a CAR, since it's not a bug. It just works that way, so there's nothing to fix. Posting an idea would be the better way to handle this.

  • Copying and remove BOR-GOS attachments from one object in other object

    As it can be realized

    I do here so
      DATA: logical_system LIKE  bapibds01-log_system ,
            all_con LIKE bdn_con OCCURS 0 WITH HEADER LINE
      CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
        IMPORTING
          own_logical_system = logical_system.
      CALL FUNCTION 'BDS_ALL_CONNECTIONS_GET'
        EXPORTING
          logical_system   = logical_system
          classname        = 'ZURKART01'
          classtype        = 'BO'
          all              = 'X'
          objkey           =  '2222222222'
          no_gos_docs      = ' '
        TABLES
    *   SIGNATURE           = my_signature
          all_connections  = all_con
      LOOP AT all_con.
        CALL FUNCTION 'BDS_BUSINESSDOCUMENT_COPY'
          EXPORTING
            logical_system        = all_con-log_system
            classname             = all_con-classname
            classtype             = all_con-classtype
            client                = all_con-client
            object_key            = all_con-objkey
            doc_id                = all_con-loio_id
            doc_ver_no            = all_con-doc_ver_no
            doc_var_id            = all_con-doc_var_id
            new_classname         = 'BUS2014'
            new_classtype         = 'BO'
            NEW_CLIENT            = SY-MANDT
            new_object_key        = '4644444444'
      ENDLOOP.
    FM ' BDS_ALL_CONNECTIONS_GET ' in the table all_con writes down some lines,
    But
    FM ' BDS_BUSINESSDOCUMENT_COPY ' gives out a mistake - ' nothing_found '
    That I do not as it is necessary

  • PM Notification to be added to Work Order object list

    Hello all,
    I am using BAPI_ALM_NOTIF_CREATE to create a notification. I am passing the Order number to the import parameter ORDERID of the bapi. After that I am using BAPI_ALM_NOTIF_SAVE and thereby using BAPI_TRANSACTION_COMMIT.
    The issue is that the notification created is not being added to the Object list of the Wor Order.

    Enable Object list Functionality in Configuration.
    IMG - PM & CS - Maintenance & Service Processing - Maintenance & Service Orders - Functions & Settings - Define Notifications & Order Integration
    For your Plant & Order type combination, select the option as All Objects assignment to Object list entries Active in Object list column.
    Then in PM Order, mention the equipment or functional location or notification. In the bottom, you can find Assignment button. Select each row in object list & click before said button to assign the operations to object list.
    Note: There are some threads available for this. Please do some search. You can find the same with screen shots as well, if any.

  • Text square with other objects in a layer

    Using Motion 4. I have a 3d scene with various layers. Each layer contains objects that are oriented differently. I'm trying to add text to one of those layers. But the text is oriented square to the screen instead of being oriented square with the other objects in that layer. How can I orient the text square to the other object. I could try to do it manually but I'm sure there is a way to do this automatically.
    Thanks

    I did find a way to do this, although I'm sure there is an easier technique I don't know about. I used the camera framing behavior to bring the layer square with the camera. Then I added the text to the layer. Finally, I removed the Camera Framing behavior to go back to the original view. No so simple but it works.

  • Why Is The Menu On The Master Page BELOW The Objects In Other Pages?

    I added a menu on the master page using the Composition widget called featured news and it stays behind the other objects on normal pages.
    How do I fix this? Here are the pictures of the menu when it's closed and when it's open.

    Make a new layer, which is by default placed above all other layers.
    Go to your master page and drag the menu onto this layer.

  • Appearance - Copy, paste, drag to other objects and enhance

    Palette appearance in Ai CS4 is a step in the right direction.
    There is missing me:
    1. The ability drag&drop individual feature from palete Appearance to add this feature to
    other objects in artboard. Or select features in palete appearance and copy and paste in to appearance other objects!
    2. In the appearance pallet in the selected object name is missing me another popup palette graphic styles for add style. Could also add a function redefinuj style changed according to values, as well as style in the texts Innd.
    3 Stroke Wieight view instead of a variety as in the Control bar + art brush selection
    Palette as a popup could also appear when I click add in the stroke palette appearance.
    4. In palete appearance shows Opacity word why why can not quickly adjust this feature for example, by the roll or write the number? You have to click and invoke popup palette. ;(
    It would be at the end of an easy way to copy the effects and etc.. between objects.
    And finally the possibility of departure of thousands of popup pallets to display as an extension of the necessary extensions to existing tools.
    In addition to the properties of cool interactive Internet also can be added and monitored as the feature of that object
    In fact, you do not have to be to build a Control Panel or Control Panel is used to extend the use of tools such as distribute;)
    What do you think?
    Can someone also so mean?
    P.S.
    In the Stroke palette is still too much space to place the stroke, as well as attributes such as:
    - Stroke overprint
    - path directions
    - add arrowhaed

    I started having this problem as well within the past few days. It seems that this is startingto become a bigger issue since the release of 10.5.4 and the MobileMe service. Most of the posts I've found in the past few days have been either in late 2002/early 2003 with Jaguar and within the past 10 days or so. That being said I am having the same issue. This is what I've found thus far.
    - Can't copy/paste, doesn't work with key combos or menus
    - Can't Drag/drop, completely unable to move files or folders around
    - iDisk disappeared
    - Can't sync to MobileMe
    - Spotlight.app had wrong permissions, d--------
    Deleted all recommended files and still no luck. I would love to backup and reinstall but again, can't copy files. So there is a bit of an issue here. Any help would be great!

  • Dynamic table overlap other objects!!!

    Hi everybody
    I have created a dynamic table with Add Row Button
    Please can anyone tell me how to avoid dynamic table overlap the below objects when multiple rows are created?
    what I wish is that the table bumps everything on his way just like MSWord wrapping option
    please provide a flash tutorial if you can, cause many people ask about this issue

    Hi,
    Use flow layout in order to avoid overlapping of table on other objects. This flow layout is to be set on the parent container (form/subform) of the table. Put the other objects too into the same container. It will cause the dynamic resizing of the container each time the new row is added.
    Thanks.
    Abhinav

  • Adding an Array of Objects into an external Web-Service

    Hi all,
    I want to populate an Array of Objects into an external Web-Service which I have introspected into BPM. But I am finding it difficult to do so which should be very easy I guess.
    When i use the EXTEND keyword for adding the array of objects, it gives me the following parameters which are not required:-
    testArray.records.extend(name : "", attributes : null, value : "", children : {  }, tagName : "", namespace : "", isNil : false);
    I only need to populate the name and value pairs and do not need to populate others. But there is no way for me to do this.. How do I populate other parameters or skip them especially
    children which is a Fuego.Xml.XMLObject[].. How do I populate that? How do I populate attributes which is an associative array and not required..
    Is there a proper documentation of consuming external Web-Services into BPM?

    Very interesting, I am going to have to really break this down and see if I can make sense out of it with my 300 lines of code LOL.
    I think this may jsut work at first glance and will let you know!
    It works. We all use it all of the time. The old Add-Member was a big pain in the neck.  InPowerShell V2 New-Object -Property ws added to take a hash of name/value pairs and convert them into an object in one step.  It is faster and more reliable.
    $myprops=@{
        Name='joe'
        Birthdate=[datetime]'02-12-1965'
        Weight=[int]130
        Married=$false
        Flags=[byte]0x3F
    # we can change a value on the fly
    $myprops.Weight+=5  # adjust weight for liars
    New-Object PsObject -Property $myprops
    OR get name=value pairs from a file and make into an object
    $fileprops=Get-Content mydata.txt | ConvertFrom-StringData
    New-Object PsObject -Property $fileProps
    There are more than a dozen other variations of how to levcerage this to create objects out of other things like results from old DOS commands.
    ¯\_(ツ)_/¯

Maybe you are looking for