Adding objects to a Map

Hi all
I have created a program that add objects to a Map
Code below shows the method used when added
public String add(int bookNumber, String title, String releaseYear, String author)
Book book = new Book(bookNumber, title, releaseYear, author);
if (library.containsKey(new Integer(book.getBookNumber())))
return "Failure - Book is already in the Library";
library.put(new Integer(book.getBookNumber()), book);
return "Success Book Added";
Trouble is when it adds the book(object) to the collection(map) it adds it anywhere in the map, eg I could have a book in place 1001 then the next book in place 1056, is there anyway I can get the method to add the object in order EG. There is a book in 1001 and when I add another object it goes to place 1002
Any help would be great
Thank all for your time
James

I don't know why you'd care about where in the Map a paticular object is but if you want it sorted you could try a TreeMap. And if you want unique keys then use a HashMap.

Similar Messages

  • Error Adding object to collection

    Hi all... I'm using Toplink + ADF Faces...
    We have the following problem: There are 2 tables involved, table A and table B
    Table B has a FK to table A, therefore a one-to-one mapping from B to A and a one to many mapping (collection) from A to B.
    What I want to do is to add an object of type B to the collection of an A object. I'm showing an input form for the constructor of type B, a submit button, and a read only table bellow to show the items of the collection. I have done this several times and worked fine, now I have NO clue why this is not working.
    What I used to do to achieve this is to call the method of the type A "addB(B)" (to add the object) and then the "Execute" operation (to refresh the table shown) of the collection in which the addB method is adding objects.
    What I get is just:
    2006-11-17 13:53:30.421 WARNING JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
    2006-11-17 13:53:30.421 WARNING java.lang.NullPointerException
    and no more details.... :-S
    Does anyone know why this could be happening???
    or
    Is there some other way of adding objects to a collection using ADF and toplink?? Any suggestion is more than welcome!! I've been trying for too long to solve this... :-(
    Thanks in advance

    Here is another symptom:
    a few days ago, I developed a search page of objects of type "C". This type, has a collection of objects of type "B". This page is working fine, now... I do exactly the same steps to create a new page with the same search functionallity, and I get the same NullPointerException described above (with no extra information).
    Since the development of that working page until now, I manually added the mapping of table "A", which was not mapped by the time we developed the working search page. So I guess something is wrong with this new mapping.
    Here are the steps i did to map the new table "A" and define the relationship with table B (through a foreing key defined in DB):
    - created Java objects from tables for table "A".
    - added a FK from "B"->"A" in table "B" in the Offline Database Sources (just like the FK in the real DB)
    - added a ValueHolder attribute to class "B" (with the appropiate get and set, and initializing it in the constructor of class "B")
    - added a List attribute in class "A" of objects of type "B" (with the appropiates add, remove, get and set methods), and initializing the List as a new ArrayList in the constructor.
    - in the toplink map, mapped the new attributes:
    one-to-one for the Valueholder in class "B" (using the appropiate FK)
    one-to-many for the List attributes in class "A" (using the appropiate FK)
    - refreshed all possible datacontrol
    And thats it... am I doing something wrong or missing something??
    Is there any other way to map a new table into an existing toplink mapping? I'm using Jdev 10.1.3 Integrated workbench...
    I will really appreciate any suggestion or comment, I really have no clue why this is happening.... Thanks in advance

  • Adding objects to list

    Hi,
    I am new java. I have a probelm adding objects to list. This is the following code.
    class Test{
    List <>dataList = new ArrayList<>();
    public List<A> getAList(){
    dataList.add(new A());
    return dataList ;
    public List<B> getBList(){
    dataList.add(new B());
    return dataList;
    }In the above code what I will pass<parameterized data> to the dataList decalred as member variable?

    bhanu wrote:
    nothing common for A and B. Both A and B are different pojos. but we can tell A and B extends from Object.I tried like that
    way. But it is not working. <? extends from Object>.Both two methods have to be in the same classYou do in that case have a bad design. Why is the same list used for both. It can't be type safe so you need to cast and the user of the list might get classcast exceptions during iteration.
    Kaj

  • Fill Container Object in Java Mapping

    Hi Everyone,
    I use BPM and defined a container object of type integer. Now I want to fill this container object in Java Mapping. After I fill it in the next step there is a switch using the value of the container.
    How can I fill the container in Java Mapping?
    Thanks for the input.

    How can I fill the container in Java Mapping?
    Mandatory to fill the container in JAVA Mapping? If not then you can try the below:
    1) Define a Container Object...already done
    2) Let the JAVA Mapping create the required message....transformation step.
    3) include a Container Operation before the Switch step (and after the Transformation)
    4) Mode as Assign...Target will  be your Container Object (integer)....Expression will be the node from the output message of JAVA mapping.
    Regards,
    Abhishek.

  • AIP-18510:  Error adding objects to configuration ... for business process.

    Hello,
    We are encountering this error few days after applying latest MLR patch.
    None of our agreements can be deployed, even those that were not changed in any way after the patch was applied.
    This is part of our ui.log:
    2009.02.02 at 08:49:10:409: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Formatted message
    2009.02.02 at 08:49:10:409: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Formatted message
    2009.02.02 at 08:49:10:409: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Rendering Page::pages/deployment/deploy_progress
    2009.02.02 at 08:49:10:421: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) In getVersionOnly()
    2009.02.02 at 08:49:10:965: Thread-24: IP - (ERROR) Error -: AIP-18510: Error adding objects to configuration CONFIG for business process cm_all_agreements
         at oracle.tip.configuration.B2BConfigurationBuilder.run(B2BConfigurationBuilder.java:452)
         at java.lang.Thread.run(Thread.java:534)
    2009.02.02 at 08:49:20:651: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Found Non Validation Errors
    2009.02.02 at 08:49:20:651: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Formatted message
    2009.02.02 at 08:49:20:651: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Formatted message
    2009.02.02 at 08:49:20:662: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Rendering Page::pages/deployment/deploy_error
    2009.02.02 at 08:49:20:673: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) In getVersionOnly()
    2009.02.02 at 08:49:27:961: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Rendering Page::pages/deployment/config_list
    2009.02.02 at 08:49:27:971: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) Executing Query::SELECT DISTINCT C.ID, C.CLASSTYPE, C.name, C.LifeCycleState, CA.aud_modified FROM TIP_Configuration_t C, TIP_Configuration_t_AUD CA WHERE C.ID = CA.ID AND C.LifeCycleState IN ('Active','Validated','Quiescing','Quiesced') AND CA.aud_modified IN ( SELECT MAX(aud_modified) FROM TIP_Configuration_t_AUD WHERE ID = C.ID GROUP BY ID) ORDER BY CA.aud_modified DESC
    2009.02.02 at 08:49:27:978: AJPRequestHandler-ApplicationServerThread-13: UI - (ERROR) In getVersionOnly()
    Please help as this renders our server useless.
    Best regards,
    Kamil

    Hi Kamil,
    I'm guessing you are talking about encountering these issues post MLR# 7 patch.
    Here are some of the things ypu could start off with:
    1. Check your LS Inventory to see if your patch was applied successfully
    2. Ensure that all the post installation steps were performed (in the readme file)
    3. You could rollback this patch and check if you are still getting the same error.
    4. After rollback, if your config works fine, rerapply the patch again and observe the effects.
    Thanks & Regards,
    Suhas.

  • Add Collada objects to the map

    Hi,
    I am able to add collada (.dae) objects to the plain white scene. Now I want to add some of the objects to the map component. I get no errors and in debug-mode the component has the objects listed.
    The Problem is: the objects are not visible on the map.
    Did I miss some specific options, which are not necessary in the plain white scene, but in the map?
    Thanks,
    Marc

    Hi Uwe,
    sorry for the missing informations, I thought it would work the same everywhere.
    I am currently working with a simple dynpro application. I can see the map, interact with it, especially add simple boxes to the map. Now I want to replace these simple boxes with 3D models. I can see these in the white scene, that works fine. But when I add the 3D objects to the map in the same way as to the white scene, everything works and says that the objects ARE on the map. The only problem is, I can not see them on the map. Even with a fly-to in creation step the map zooms to an empty place on the map (except for the map itself).
    The VBI version should be 2.1, on our backend is UI2_700, UI2_701, UI2_702, UI2_731.
    Greetings,
    Marc

  • Adding Object Mannully Vs. Adding Object in SU24 for Tranaction

    All,
    What is the diff. between Adding a missing Object Mannully in PFCG  Vs. Adding Object in SU24 for Tranaction ?
    What is the diff. between chaning Vaule for a missing Object Mannully in PFCG  Vs. Changing a value in SU24 for a Auth Ojbect ?
    Please let me know.
    From
    PT.

    Hi PT,
    There is no direct link between transactions and the auth objects assigned to them via PFCG.  Things like config and the way transaction are used have an impact on how the auths are evaluated for a given transaction.
    As you know, we use SU24 to update the SAP delivered values to meet the auth checks in our particular implementations or as per our requirements.  What this enables us to do is to ensure that when we enter a transaction, all the relevant auth objects and where appropriate fixed values are pulled through (so if you know that different usages of that tx requires different values then add the object in SU24 but leave the relevant field blank).  If you remove that transaction from the role, the auths that are also required are removed from the role too, as long as the role is not in Manual or Changed status.
    If you manually add the auth object then you have no link with the transaction/s that are required to run the object.  You can remove the transaction and the auth object value will remain in the role.  If not properly managed, you can end up with excess auths still present in roles, particularly with the S_* objects and in areas like FI where it is very easy to skip between transactions through menu options where there is no S_TCODE check, with the auth object check being the only controlling one.
    Manually entered objects definitely have their uses as long as they are properly documented and managed when maintaining roles.

  • Problem by adding attachments in Java Mapping

    Hi,
    we have to add some attachments in Java Mapping.
    So we are using the Java Mapping API.
    But it doesn't work correctly.
    We got the following error in sxmb_moni:
    Attribute Manifest ExampleAttachment is initial
    So we checked what happened in the Manifest and in the SAP SOAP Envelope and we see that there is an inconsistence.
    In the SAP Manifest we find the following entries:
    <SAP:Manifest xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7">
         <SAP:Payload xlink:href="cid:payload-79a6e3c088db11dfa4dd0017a477c1e8<at>sap.com">
              <SAP:Name>MainDocument</SAP:Name>
              <SAP:Description/>
              <SAP:Type>Application</SAP:Type>
         </SAP:Payload>
         <SAP:Payload xlink:href="ExampleAttachment">
              <SAP:Name>ExampleAttachment</SAP:Name>
              <SAP:Description/>
              <SAP:Type>ApplicationAttachment</SAP:Type>
         </SAP:Payload>
    </SAP:Manifest>
    For us it seems the entry for our ExampleAttachment is wrong. I think there must be a real content id for the attachment like the cid for the MainDocument. In the SOAP Envelope you can find the following entry for the attachment:
    content-type:text/plain
    content-length:45
    content-id:payload-79a6e3c088db11dfa4dd0017a477c1e8<at>sap.com
    This is an example for an attachment!
    --SAP_0017A477C1EC1DEFA3D200A5CB55CE04_END--
    So here you can see a real content ID, but you can't find it in the Manifest.
    So do we anything wrong in our source code or is it a bug of the SAP API?
    Do you have any ideas?
    Here the Java Mapping we're using for adding an attachment (as a test):
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.DynamicConfigurationKey;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    import com.sap.aii.mapping.api.Attachment;
    public class SUSAttaHandler extends AbstractTransformation {
         private static final DynamicConfigurationKey KEY_FILENAME    = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
         // Transform Method
         public void transform(TransformationInput in, TransformationOutput out)
                   throws StreamTransformationException {
              // An info message is added to trace
              getTrace().addWarning("JAVA Mapping AttaHandler called!");
              // Input payload
              String inData = convertStreamToString(in.getInputPayload().getInputStream());
              // dynamic configuration
              DynamicConfiguration conf = in.getDynamicConfiguration();
              String fileName          = conf.get(KEY_FILENAME);
              getTrace().addWarning("AttaHandler: FileName = " + fileName);
              String text = new String("This is an example for an attachment!");
              Attachment atta = out.getOutputAttachments().create("ExampleAttachment", "text/plain", text.getBytes());
              out.getOutputAttachments().setAttachment(atta);
              String outData = inData;
              try {
                   out.getOutputPayload().getOutputStream().write(outData.getBytes("UTF-8"));
              catch(Exception exception1) { }
         // convert Stream to String
         public String convertStreamToString(InputStream in){
              StringBuffer sb = new StringBuffer();
              try {
                   InputStreamReader isr = new InputStreamReader(in);
                   Reader reader = new BufferedReader(isr);
                   int ch;
                   while((ch = in.read()) > -1) {
                        sb.append((char)ch);}
                        reader.close();
              } catch(Exception exception) { }
              return sb.toString();
    Thanks for your help,
    Thorsten

    Hi,
    we created an OSS ticket for this problem and SAP created a SAP note.
    Here the number of the note: 0001501345
    I hope this will help you.
    Thorsten

  • Adding objects to the stage & acceessing stage properties - I'm a bit confused..

    Hi,
    I'm a little confused on two fronts regarding display
    programming:
    A. What the best way to add objects to the stage?
    B. How to access stage properties.
    I can do both of these when the project is an 'Action Script
    Project', but I'm having trouble when it is a 'Flex Project' (e.g.
    an MXML file). See the two attached files with questions included
    in the comment to see exactly what I mean.
    A. What the best way to add objects to the stage?
    =====================================
    In an action script project that extends Sprite I can just
    call addChild()
    In an MXML project I can add objects to the stage by first
    adding them to a UIComponent, then adding that to the stage.
    1. Is that the best way to do it?
    In this doc:
    http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_02.html
    it says that
    quote:
    Each SWF file has an associated ActionScript class, known as
    the main class of the SWF file. When Flash Player opens a SWF file
    in an HTML page, Flash Player calls the constructor function for
    that class and the instance that is created (which is always a type
    of display object) is added as a child of the Stage object. The
    main class of a SWF file always extends the Sprite class
    2. why cant I just add a sprite object direct to the stage
    without the UIComponent?
    3. What is the 'main class', and how can i get access to it?
    B. How to access stage properties.
    =========================
    In an action script project that extends Sprite I can just
    call trace(stage.framerate)
    But in an MXML file I cannot figure out how to access the
    stage properties.
    See the attached code for the things that I tried, but which
    didnt work.
    In the page:
    http://www.actionscript.org/forums/showthread.php3?t=140655
    It says
    quote:
    For stage access you have a couple of rules:
    * natively, only display objects have inherent access to
    stage
    * display objects only have a valid reference to stage if
    they're within the stage's display list (on the screen, after added
    to it with addChild)
    * The only display objects which immediately have access to
    the stage before the use of addChild (in their constructor) are the
    document/application class instance (root) and any instance from
    the library placed on the timeline (not created with AS).
    * Non-display object classes have to be passed or assigned a
    reference to the stage from another object which already has access
    to it - they cannot access it otherwise.
    4. How do I access the stage properties in the MXML project?
    5. I suspect this is related to the "main class", which I
    dont yet understand - is it?
    Sorry for the long post.
    cheers
    tom

    "tom saffell" <[email protected]> wrote in
    message
    news:gd7cm9$d1v$[email protected]..
    > Thanks Luigi - that helps a lot.
    > I hadnt seen the Flex 3 Developer Guide before - it's
    very useful.
    >
    > I now see that I can access properties of the
    application object directly
    > with
    > this.<property>.
    > However, the framerate property cannot be set by
    actionscript, only in
    > MXML (I
    > can set it in the <mx:application> tag). But I
    need to be able to set it
    > programatically, dependent on user input.
    >
    > 5. Is there a way around this?
    > 6. Can I set the stage's framerate to achieve the same
    outcome?
    >
    > I still dont understand why I cannot access the stage
    object. When I call
    > either
    this.stage or
    uic.stage * then I get
    quote:
    Cannot access
    > a
    > property or method of a null object reference.
    My understanding is
    > that I
    > can access the stage object via any display object on
    the display list.
    > I'm
    > confused about this bit..
    >
    > * - uic is a UIComponent that has been added to the
    display list (i think)
    > by
    > calling addChild(uic) from the AS3 within the
    application
    >
    > 7. How do I access stage properties in AS3 in an MXML
    project?
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=05_Display_Programming_10.html
    It seems like possibly your real problem is that you're
    having trouble
    searching the Help effectively:
    http://flexdiary.blogspot.com/2008/07/getting-help-in-flex-builder.html

  • Using Container Object in Java Mapping

    Hi All,
    I need to use a Container object inside a Java Mapping, just like the one wich is used in the Graphical Mapping.
    Here is the scenario:
    I have an Interface Mapping with three steps on it.
    The first step is a Java Mapping just to put some info in the Container. The second step is a XSLT transformation that uses an XSLT file to transforms from IDOC to xCBL. The third step is another Java Mapping that get the info from the Container and insert in the xCBL.
    Does any one knows how to do it inside the Java Mapping Code? We cannot make modifications in the XSLT file because of some internal restrictions.
    Thanks,

    Hi,
    If you make the container variable is a part of your message (input of Java Mapping) then you can access as normal fields.
    Just have a look at these discussions-
    How to use Container Variable across Maps
    xi 3.0 - Using BPM variables in messages
    Hope this helps,
    Regards,
    Moorthy

  • Unale to get XSLT object in interface mapping

    Hi
    i had imported the zip file contaning xslt file for mapping in Import Archives .But during interface mapping, integration builder is not able to show me the created import archive object.
    Please Help me out.

    Hai Mitesh,
    After u r importing a <b>Zip</b> file ( which the zip file contains (<b>.xsl</b> extension...)),  make sure in the interface mapping to select xsl type and clik F4 to Select the zip file in the mapping program... and if u doesnt see ...
    try by clicking Environment --> Cache notifications and click refresh for some secs... then proceed with above steps u will <b>definitely</b> get...
    Regards,
    sridhar reddy . k

  • I created a vector and added objects, but the vector is empty

    I created an object called a facility, it accepts 2 strings in the creator but stores the data as a string and a float. as you can see from the code below, i have tried to create a vector object to contain facilitys and named it entries. when i add objects to this vector, the vectors size does not change, and i cannot access elements of it via their index. but when i print the vector out i can see the elements? what is going on here. i am very confused. ps, if it helps i havent worked with vectors much before.
    FacilitysTest.java
    import java.util.*;
    public class FacilitysTest {
         public static void main (String [] args) {
         Facilitys entries = new Facilitys();
         entries.add("Stage","3.56");
         entries.add("kitchen","5.00");
         entries.add("heating","2");
    //     System.out.println(entries.firstElement() );
         System.out.println("printing out entries");
         System.out.println(entries);
         System.out.println();
         System.out.println("There are "+entries.size()+" entries");
         System.out.println();
         System.out.println("modifying entry 2");
         entries.setElementAt(new Facility("lighting","1.34"), 2);
         System.out.println(entries);
         System.out.println();
         System.out.println("deleting entry 1");
         entries.remove(1);
         System.out.println(entries);
    }the following is what happens when i run this code.
    the number (0,1,2) is taken from a unique number assigned to the facility and is not anything to do with the facilitys position in the vector.
    printing out entries
    Facility number: 0, Name: Stage , Cost/Hour: 3.56
    Facility number: 1, Name: kitchen , Cost/Hour: 5.0
    Facility number: 2, Name: heating , Cost/Hour: 2.0
    There are 0 entries
    modifying entry 2
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 >= 0
    at java.util.Vector.setElementAt(Vector.java:489)
    at FacilitysTest.main(FacilitysTest.java:17)
    Press any key to continue . . .
    Facilitys.java
    import java.util.*;
    public class Facilitys extends Vector {
         private Vector entries;
         public Facilitys( ) {
                 entries = new Vector();
        public void add( String name, String price ) {
             entries.add((new Facility( name, price) ));
        public Facility get(int index) {
              return ((Facility)entries.get(index));
         public float total() {
              float total = 0;
              for (int i = 0; i<entries.size();i++) {
                   total = total + ( (Facility)entries.get(i) ).getPricePerHour();
              return total;
        public String toString( ) {
            StringBuffer temp = new StringBuffer();
            for (int i = 0; i < entries.size(); ++i) {
                temp.append( entries.get(i).toString() + "\n" );
            return temp.toString();
    }

    are you reffering to where i have public class
    Facilitys extends Vector {
         private Vector entries;
         public Facilitys( ) {
                 entries = new Vector();
    That's correct. That's your problem.
    i added the extends Vector, because without it i got
    the following errors
    C:\Documents and Settings\george\My
    Documents\University\JavaCode\CM0112\FacilitysTest.jav
    a:14: cannot find symbol
    symbol : method size()
    location: class Facilitys
    System.out.println("There are "+entries.size()+"
    " entries");That's because you haven't implemented a size method in your class.
    ^
    C:\Documents and Settings\george\My
    Documents\University\JavaCode\CM0112\FacilitysTest.jav
    a:17: cannot find symbol
    symbol : method setElementAt(Facility,int)
    location: class Facilitys
    entries.setElementAt(new
    w Facility("lighting","1.34"), 2);That's because you haven't implemented setElementAt in your class.
    C:\Documents and Settings\george\My
    Documents\University\JavaCode\CM0112\FacilitysTest.jav
    a:21: cannot find symbol
    symbol : method remove(int)
    location: class Facilitys
         entries.remove(1);
    ^That's because you haven't implemented remove in your class.
    /Kaj

  • Adding objects into query Panel and no display report

    Hi Folks,
    I had an issue with WEBI .
    Iam running the report with few objects at first time , all objects are displayed in the  table format of report.
    I saved and closed the report .
    Later  i opened the report and edited the report by adding new objects into query panel and runing it.
    but this time  i did not find the new objects in display table in report as like DeskI.
    If we find the solution for this , it will be great help to me.
    Thanks
    Mahesh

    The objects will be in the data tab. Objects are not automatically added to your report in Webi, they are made available in the data panel, and you can choose which objects to add.

  • Problem with adding objects to a collection

    Hi
    Been using this forum for a couple of years now to help me with my code, but it's the first time that I've had a problem which I couldn't find the answer for!
    I'm trying to create two classes one called Reminder and one called Engagement. The Reminder class needs to hold a list of Engagement objects, but whenever I add a new Engagement object to the ArrayList I have created in Reminder and try to retreive it I get a null value.
    If anyone can give me an idea of where I have gone wrong that would be most helpful,
    Thank you in advance,
    Steve
    Code:
    package reminder;
    import java.util.*;
    public class Reminder{
        private GregorianCalendar date       = null;
        private String            reason     = null;
        private Engagement        engagement = null;
        private List<Engagement>  appointments;
        private int year = 0;
        private int month = 0;
        private int day = 0;
        public Reminder() { //the constructor
            appointments = new ArrayList<Engagement>();
        } //end constructor
        public void add(int d, int m, int y, String r){ //this method takes an engagement object and adds it to the list
        //public void add(Engagement engagement){
            day   = d;
            month = m;
            year  = y;
            reason = r;
            appointments.add(new Engagement (new GregorianCalendar(y,m,d), reason));
            System.out.println(day + "-" + month + "-" + year);//(new Engagement (date, reason));
            appointments.add(new Engagement(new GregorianCalendar(2008,4,2), "My first appointment"));
            System.out.println("\nThere are this number of items in the list: " + appointments.size()); //this was to check the item was added
        public void getAppointments(){
            //private int arrayPosition = 0;
            //Iterator it = appointments.iterator();
            for (Iterator it = appointments.iterator(); it.hasNext();){
                System.out.println(it.next());//.appointments.toString());
                //it.next();
    package reminder;
    import java.util.*;
    import reminder.*;
    public class Engagement{
        private GregorianCalendar date = null;
        private String reason = null;
        /** Creates a new instance of Engagement */
        public Engagement(GregorianCalendar d, String r) {
            date   = d;
            reason = r;
        public String getReason() {
            System.out.println(reason);
            return null;
    public class Main { //main class to test the other classes
        /** Creates a new instance of Main */
         * @param args the command line arguments
        public static void main(String[] args) {
            Reminder reminderList = new Reminder(); //create an instance of Reminder
            reminderList.add(2,4,2008, "My first appointment");
            reminderList.add(6,10,2009, "My second appointment");
            reminderList.add(2,4,2007, "My third appointment");
            reminderList.getAppointments();
    }

    Hi Guys
    Just wanted to let you know that I have realised where I went wrong, if you look in the Engagement class there is a method called toString(); which just has a return value of null, that is why I was getting the null values!
    Sorry for wasting your time, it took me three hours to realise why it wasn't working before I contacted you and about an hour after I posted I realised what the problem was.
    One other thing... why is reminderList bad naming? I was going to call the instance reminder but because the class holds a list of objects I thought I'd call it reminderList..
    Thanks
    Steve

  • Sybase SAPCRM Iphone. Adding filters in the map identifying the customers

    Hi,
    For our client, we have to do some enhancement on the map which displays the customers and the prospects around an address.
    The standard version allow as to identify customers, contacts or opportunities without any specific filter on these objects.  We would like to add some filters to display only some specific customers.
    To expand this functionality, we have 3 options. We would like to have your opinion about the feasibility, the complexity and above all  we would like to be sure that this kind of modifications will not impact the standard maintenance of this functionality.
    1.     Option 1: To have filters on the customers using Marketing attributes or other customer fields.
    2.     Option 2: To add a new object which will be identified on the MAP: Activities having a specific type or a specific status.
    3.     Option 3: To add some intelligence in the customers selection, to be able to identify customers having an opportunity or an activity with a specific status. There will be then different variants: Selections of customers having an opportunity, selections of customers who have not be visited since a period u2026
    Thank you in advance

    The program can't start because MSVCR80.dll is missing from your computer
    Many thanks. Rather than the Apple document, I currently recommend using the instructions from the following user tip with that one:
    Troubleshooting issues with iTunes for Windows updates

Maybe you are looking for

  • How to Track which Super user change the License Administration

    Hi Experts, My client recently encounter the License was allocated from a particular user id by an super user, resulting the end user unable to perform transaction when log onto SAP B1 8.8 PL19. Is there any way which we can trace and control which s

  • Generating a report w/ block diagram & programatically specified case structure?

    Hi, I am trying to generate a report that shows the block diagram for a programatically specific case structure. The case structure has ~90 cases and is selected by a custom control. I'm on Labview 8.5 I've found with the Append Block Diagram to VI,

  • During utilization showing message

    Hi, While creating the excise invoice for export, and clicking on the utilization button I am getting a msg that 'Excise tax indicator not maintained for 1 J_1IEXESTA - please maintain'. But this is not preventing me to do the further processing.The

  • Plz help On this Topic

    Hi How to run Servlets in WebSphere Application Server? Any One can Help Me Plz Bye Kumar

  • Opening a file (viewed as icons) from within application  icons too large!

    Help! I'm not a newbie LOL.. I don't know when this error happened but apparently I cant just do a command J to get the view options to pop up while in an application. Here's my problem. I can view files as icons prefectly from within finder. I setup