Confusion about get/set method not working

Hi
Hopefully someone can point out the elementary mistake I have made in my code. I have created a get/set method to hold a value"total" so that I can then get it to display it further down my code in an HTML page. I am setting the value as I can check this by printing it out (line 102) but when I try to use it again it displays 0.0. What have I done wrong?
class ReportListener implements ActionListener
     Context context;
     ResultSet resultAll;
     ResultSet resultTotal;
     JFrame frame;
     int daysInMonth;
     int i;
     DisplayCurrencyOnBills d;
     DateFormatSymbols symbols;
     String[] newWeekday;
     Date theDate;
     String date;
     ReportListener (Context theContext)
          context = theContext;
     public void actionPerformed(ActionEvent e)
       try
          printWeeklyReport();
          //countDaysInMonth();
          getReportMoneyTotal();
     catch (SQLException s)
               s.printStackTrace();
     public void countDaysInMonth()
     public void getReportMoneyTotal() throws SQLException
          Calendar todayTotal =Calendar.getInstance() ;
           SimpleDateFormat reportDateFormat = new SimpleDateFormat("dd MM yyyy");
          PreparedStatement preparedT =context.getConnection().prepareStatement(
               "SELECT Sum(tblSession.Fee) AS Total, Count(tblBooking.BookingID) AS CountOfBookingID FROM tblSession INNER JOIN "+
               "(tblBooking INNER JOIN tblCustomer_Booking ON tblBooking.BookingID = tblCustomer_Booking.BookingID) ON tblSession.SessionID = tblBooking.SessionID "+
               "WHERE (((tblBooking.EventDate)>DateAdd('m',-1,#"+reportDateFormat.format(todayTotal.getTime())+"#)) AND ((tblSession.Session)='Morning' Or (tblSession.Session)='Evening')) OR (((tblSession.Session)='Afternoon') AND ((tblBooking.Extension)=Yes))"
          ResultSet resultTotal =preparedT.executeQuery();
          resultTotal.next();
          double total =resultTotal.getDouble("Total");     
          context.setReportIncomeTotal(total);
          System.out.println("Line 102 "+context.getReportIncomeTotal());
          preparedT.close();
     public void printWeeklyReport() throws SQLException
          Calendar today =Calendar.getInstance() ;
           SimpleDateFormat reportDateFormat = new SimpleDateFormat("dd MM yyyy");
          PreparedStatement prepared =context.getConnection().prepareStatement(
               "SELECT tblBooking.EventDate, tblSession.Session, tblBooking.Extension, tblSession.Fee, Count(tblBooking.BookingID) AS CountOfBookingID "+
               "FROM tblSession INNER JOIN (tblBooking INNER JOIN tblCustomer_Booking ON tblBooking.BookingID = tblCustomer_Booking.BookingID) ON "+
               "tblSession.SessionID = tblBooking.SessionID GROUP BY tblBooking.EventDate, tblSession.Session, tblBooking.Extension, tblSession.Fee "+
               "HAVING (((tblBooking.EventDate)>DateAdd('m',-1,#"+reportDateFormat.format(today.getTime())+"#)) AND ((tblSession.Session)='Morning' Or "+
               "(tblSession.Session)='Evening')) OR (((tblSession.Session)='Afternoon') AND ((tblBooking.Extension)=Yes))"
          ResultSet resultAll =prepared.executeQuery();
          resultAll.next();
          System.out.println("Line 123 "+context.getReportIncomeTotal());
                    PrintWriter printWriter;
                    try
                         JFileChooser fc=new JFileChooser();
                         int returnVal = fc.showSaveDialog(frame);
                         if (returnVal != JFileChooser.APPROVE_OPTION)
                              return;
                         FileOutputStream outputStream=
                              new FileOutputStream(fc.getSelectedFile());
                         OutputStreamWriter writer=
                              new OutputStreamWriter(outputStream,"UTF-8");
                         printWriter=new PrintWriter(writer);     
                       printWriter.println("<html><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><body><h1>Monthly Usage Statistics</h1>");
                       printWriter.println("<table width='100%' border='1'><tr><td width='100%' colspan='8'><h2 align='center'>Monthly Summary</h2></td></tr>");
                     System.out.println("Line 152 "+context.getReportIncomeTotal());
                     int count = 0;
                         while ( resultAll.next() )
                          count++;
                          String session = resultAll.getString("Session");
                          Double fee= resultAll.getDouble("Fee");
                       // display currency correctly
                     //double d=Double.parseDouble(fee);
                     Locale locale = new Locale("GBP");
                     NumberFormat gbpFormat = NumberFormat.getCurrencyInstance(locale);
                         symbols = new DateFormatSymbols(new Locale("en"));
                     newWeekday =symbols.getWeekdays();
                         SimpleDateFormat formatter = new SimpleDateFormat("EEEE",symbols);
                         Date theEventDate = new Date();
                         theEventDate=resultAll.getDate("EventDate");
                         date = formatter.format(theEventDate);
                         // set date for Usage Report
                         Calendar reportDate = Calendar.getInstance();
                         Calendar reportToday =Calendar.getInstance();
                         reportDate.add(Calendar.MONTH,-1);
                         SimpleDateFormat reportFormat = new SimpleDateFormat("EEEE ,dd MMM yyy");     
                         //setDecimalFormat for report total
                         DecimalFormat decFormat = new DecimalFormat(".##");
                         printWriter.println(
                         "<tr><td width='100%' colspan='8'>For month from "+reportFormat.format(reportDate.getTime())+" to "+reportFormat.format(reportToday.getTime())+"</td></tr><tr><td width='100%' colspan='8'>Total amount of income from occasional bookings "+decFormat.format(context.getReportIncomeTotal())+"</td>"+
                           "</tr><tr><td width='100%' colspan='8'>Percentage use for all bookings</td></tr><tr><td width='8%'></td><td width='8%'>MON</td><td width='9%'>TUES</td>"+
                        "<td width='9%'>WEDS</td><td width='9%'>THURS</td><td width='9%'>FRI</td><td width='9%'>SAT</td><td width='9%'>SUN</td></tr><tr><td width='8%'>AM</td><td width='8%'></td>"+
                        "<td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td></tr><tr><td width='8%'>PM</td><td width='8%'></td>"+
                        "<td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td></tr><tr><td width='8%'>EVE</td><td width='8%'></td>"+
                        "<td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td><td width='9%'></td></tr>"
                         System.out.println(count);
                         printWriter.println("</table>");
                         printWriter.println("</body></html>");
                         printWriter.close();
                         prepared.close();
                         JDialog reportDialog=new JDialog(frame);
                         reportDialog.setSize(800,600);
                         JEditorPane editorPane=new JEditorPane(fc.getSelectedFile().toURL());
                         editorPane.setContentType("text/html; charset=UTF-8");
                         reportDialog.getContentPane().add(editorPane);
                         reportDialog.setVisible(true);
                    catch (IOException exception)
                         exception.printStackTrace();
     This code finds data from a database(this works as it also prints a report). Here is the extraxt of my get/set method which is located in a "context" class.
public void setReportIncomeTotal(double total)
          this.total=total;
     public double getReportIncomeTotal()
          return total;
     }I'd be grateful for any help.

but when I try to use it again it displays 0.0This seems to mean that either the value has been reset or you are calling the method on another (new) ReportListener.
It's hard to say, as you didn't provide us with the code sample that illustrate the corresponding scenario (did you?.)
Note that I didn't get into details, but I just noticed that your actionPerformed method first print weekly report, and then get the money total. (Shouldn't it be the opposite order?)

Similar Messages

  • Getter & Setter Method not getting called for a field enhanced through AET

    Hello,
    I am new to SAP CRM 7.0 and working on a requirement.
    A Z-field was added by our functional guy in CRM 7.0 WebGui through AET in the 'Create Opportunity' transaction (Header data).
    Now the requirement is, as soon as the opportunity is created through the WebGui, I should post a document in R/3 and paste that document number back to the enhanced Z-field in opportunity.
    Work done by me:
    I pressed F2 on the enhanced Z-field in the WebGui screen and took the details of view, component name etc. After this I went to normal SAP CRM system and open tcode "BSP_WD_CMPWB", located the corresponding view "BT111H_OPPT/Details" and right clicked & enhanced the same.
    Then I opened the structure of this view, expanded context node, located context "BTOPPORTH" and inside this, located my Z-attribute. Now right clicked on the Z-attribute & selected the option "Generate SETTER & GETTER Methods" and these were generated successfully.
    Problem:
    The problem is even after putting external break points in these methods, these methods are not getting called while creating, modifying & displaying the Opportunity in WebGui.
    I hope that for the requirements that I have, I have to do the coding in "Getter & Setter" methods. But since these are not getting called, I am unable to proceed.
    Please help/suggest how to achieve this.
    Thanks in anticipation.
    Best Regards,
    Rahul Malani

    Hi,
    If you can see the field in UI and still get_ method is not being triggered then try to regenerate these methods. If it still doesn't work then please look for SAP notes or raise an OSS.
    There should be some note for the issue you faced.
    please refer:
    Help Needed immediately - AET getter setter methods not getting triggered
    Regards,
    BJ

  • Getter/setter methods -- how do I use the return values

    I'm just learning Java, and I haven't been to this site since the end of July, I think. I have a question regarding getter and setter methods. I switched to the book Head First Java after a poster here recommended it. I'm only about a hundred pages into the book, so the code I'm submitting here reflects that. It's the beginnings of a program I'd eventually like to complete that will take the entered information of my CD's and alphabetize them according to whatever criteria I (or any user for that matter) choose. I realize that this is just the very beginning, and I don't expect to have the complete program completed any time soon -- it's my long term goal, but I thought I could take what I'm learning in the book and put it to practical use as I go along (or at lest try to).
    Yes I could have this already done it Excel, but where's the fun and challenge in that? :) Here's the code:
    // This program allows the user to enter CD information - Artist name, album title, and year of release -- and then organizes it according the the user's choice according to the user's criteria -- either by artist name, then title, then year of release, or by any other order according to the user's choice.
    //First, the class CDList is created, along with the necessary variables.
    class CDList{
         private String artistName;//only one string for the artist name -- including spaces.
         private String albumTitle;//only one string the title name -- including spaces.
         private int yearOfRelease;
         private String recordLabel;
         public void setArtistName(String artist){
         artistName = artist;
         public void setAlbumTitle(String album){
         albumTitle = album;
         public void setYearOfRelease(int yor){
         yearOfRelease = yor;
         public void setLabel(String label){
         recordLabel = label;
         public String getArtistName(){
         return artistName;
         public String getAlbumTitle(){
         return albumTitle;
         public int getYearOfRelease(){
         return yearOfRelease;
        public String getLabel(){
        return recordLabel;
    void printout () {
           System.out.println ("Artist Name: " + getArtistName());
           System.out.println ("Album Title: " + getAlbumTitle());
           System.out.println ("Year of Release: " + getYearOfRelease());
           System.out.println ("Record Label: " + getLabel());
           System.out.println ();
    import static java.lang.System.out;
    import java.util.Scanner;
    class CDListTestDrive {
         public static void main( String[] args ) {
              Scanner s=new Scanner(System.in);
              CDList[] Record = new CDList[4];
              int x=0;     
              while (x<4) {
              Record[x]=new CDList();
              out.println ("Artist Name: ");
              String artist = s.nextLine();
              Record[x].setArtistName(artist);
              out.println ("Album Title: ");
              String album = s.nextLine();
              Record[x].setAlbumTitle(album);
              out.println ("Year of Release: ");
              int yor= s.nextInt();
                    s.nextLine();
              Record[x].setYearOfRelease(yor);
              out.println ("Record Label: ");
              String label = s.nextLine();
              Record[x].setLabel(label);
              System.out.println();
              x=x+1;//moves to next CDList object;
              x=0;
              while (x<4) {
              Record[x].getArtistName();
              Record[x].getAlbumTitle();
              Record[x].getYearOfRelease();
              Record[x].getLabel();
              Record[x].printout();
              x=x+1;
                   out.println("Enter a Record Number: ");
                   x=s.nextInt();
                   x=x-1;
                   Record[x].getArtistName();
                Record[x].getAlbumTitle();
                Record[x].getYearOfRelease();
                Record[x].getLabel();
                Record[x].printout();
         }//end main
    }//end class          First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.
    Edited by: Straitsfan on Sep 29, 2009 2:03 PM

    Straitsfan wrote:
    First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.Yes, there is tons you could have done more efficiently. But this is something every new programmer goes through, and I will not spoil the fun. You see, in 3 to 6 months when you have learned much more Java, assuming you stick with it, you will look back at this and be like "what the hell was I thinking" and then realize just haw far you have come. So enjoy that moment and don't spoil it now by asking for what could have been better/ more efficient. If it works it works, just be happy it works.
    Straitsfan wrote:
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.First, if you posted this somewhere else you should link to that post, it is good you at least said you did, but doubleposting is considered very rude because what inevitably happens in many cases is the responses are weighed against each other. So you are basically setting anyone up who responds to the post for a trap that could make them look bad when you double post.
    You are setting you getters and setters up right as far as I can tell. Which tells me that I think you grasp that a getter lets another class get the variables data, and a setter lets another class set the data. One thing, be sure to use the full variable name so you should have setRecordLabel() and getRecodLabel() as opposed to setLabel() and getLabel(). Think about what happens if you go back and add a label field to the CDList class, bad things the way you have it currently. Sometimes shortcuts are not your friend.
    And yes, you are using the getters all wrong since you are not saving off what they return, frankly I am suprised it compiles. It works because you don't really need to use the getters where you have them since the CDList Record (should be lowercase R by the way) object already knows the data and uses it in the printout() method. Basically what you are doing in lines like:
    Record[x].getArtistName();is asking for the ArtistName in Record[x] and then getting the name and just dropping it on the floor. You need to store it in something if you want to keep it, like:
    String artistName = Record[x].getArtistName();See how that works?
    Hope this helped, keep up the good learning and good luck.
    JSG

  • Get/set methods

    I've been programming in java for a while now, but just recently i started wondering about something. Doesn't get/set methods that contain no other code defeat the point of encapsulation? i.e
    public void getXxx() {
    return xxx;
    But now to the important question. Does the javac compiler inline get/set methods and if yes, how does it work around the private access to the data members?

    yes you are right. first all variables should be private (there are some cases where protected is useful). that being hte case, all access methods do is expose the way this class does its storage. and will break if that changes. for example, a rectange using int for width and height, has corresponding setWidth( int ), getHeight() etc. now the author of the class changes int to a Point. now there should only be get/setPoint and the previous should be removed. this changes the API and breaks code using this class.
    Lets say one keeps the setWidth etc as 'doing no harm', then the question is why does one need this? commonly used in eg
    setWidth( getWidth() + 10 );
    to lenghten the width.
    A better way is to capture this need in the messaging system. therefore have a method:
    widenBy( int w ) {
    width += w;
    notice this way, when changing the private width variable from int, to Point, to Long or any other, does not break code. there is no need to tidy up the access methods either.
    classes that have no behaviour are often created to group variables together and passed along for convenience. These are not strictly classes. Then why not have variables public and save the method calls to access methods. Having access methods does not make it more OO. These 'classes' should be defined as inner classes of the enclosing class.
    I've been programming in java for a while now, but
    just recently i started wondering about something.
    Doesn't get/set methods that contain no other code
    defeat the point of encapsulation? i.e

  • Dynamic rooting (User Record) setting is not working in Nakisa OrgChart SP3

    Dear All
    The Dynamic rooting setting is not working in the Nakisa OrgChart SP3.
    It is giving an error message - "Cannot find the root of your orgchart. The orgchart box may have been deleted or incorrectly specified, or no valid org structure can be found for the selected effective date. Please change the root of the chart or select another effective date."
    We followed the same steps as given in the Admin guide of SP3 (P.no. 109 - shown below)
    In Orgchart --> General Settings:
    * Select the Org chart root value source.
    User Record: Retrieves the record specified in the next step from the employee data element.
    *Do one of the following to define the org chart root:
    If User Record was selected in the previous step, select the field containing the ID of the required organizational object in the employee data element from the User record field drop-down list. For example, if you wish to root the org chart at the org unit of the logged-in user, select the field containing the org unit ID. Hence, we have selected the Org unit ID.
    Note:
    We had enabled single sign-on with logon tickets
    Retained the standard settings in Security Settings --> Employee Source
    Had provided full authorization to the roles
    If we use the "OrgChart Root" option available in 'Orgchart root value source', the org structure gets displayed correctly from the root object defined.
    As this is an standard functionality, Kindly guide us in resolving the issue.
    Regards
    Ravindra

    Ravindra.
    You don't have to and shouldn't always include the username and password parameters for the SAP Connection string.  When you omit them it will use the user's login credentials.
    Remember though that:
    The SAPRoleMappingConnection will need them included in order to get the details for the user in the first place.
    Without the username and password specified in a connection string you can't click the option to test the connection and result in a successful connection.  Remember unable to connect does not necessarily equate to wrongly configured.
    I've filtered the log file for errors and the following entries were flagged up:
    26 Jun 2012 10:00:06 ERROR com.nakisa.Logger  - com.nakisa.framework.utility.Files : deleteFile : java.io.IOException: Unable to delete file: E:\usr\sap\D15\J00\j2ee\cluster\apps\Nakisa\OrgChart\servlet_jsp\OrgChart\root\.system\Admin_Config\__000__THY_SAP_Live_RFC_01\AppResources\attr.txt
    26 Jun 2012 13:13:52 ERROR com.nakisa.Logger  - com.nakisa.framework.utility.Files : deleteFile : java.io.IOException: Unable to delete file: E:\usr\sap\D15\J00\j2ee\cluster\apps\Nakisa\OrgChart\servlet_jsp\OrgChart\root\.system\Admin_Config\__000__THY_SAP_Live_RFC_01\AppResources\attr.txt
    26 Jun 2012 13:43:49 ERROR com.nakisa.Logger  - java.lang.reflect.InvocationTargetException
    26 Jun 2012 13:55:09 ERROR com.nakisa.Logger  - com.nakisa.framework.utility.Files : deleteFile : java.io.IOException: Unable to delete file: E:\usr\sap\D15\J00\j2ee\cluster\apps\Nakisa\OrgChart\servlet_jsp\OrgChart\root\.system\Admin_Config\__000__THY_SAP_Live_RFC_01\AppResources\attr.txt
    26 Jun 2012 14:32:03 ERROR com.nakisa.Logger  - com.nakisa.framework.utility.Files : deleteFile : java.io.IOException: Unable to delete file: E:\usr\sap\D15\J00\j2ee\cluster\apps\Nakisa\OrgChart\servlet_jsp\OrgChart\root\.system\Admin_Config\__000__THY_SAP_Live_RFC_01\AppResources\attr.txt
    26 Jun 2012 15:47:44 ERROR com.nakisa.Logger  - BAPI_SAP_OTFProcessor_LinkedDataElement : The dataelement ( SAPPositionVacancyDataElement ) is not defined.
    26 Jun 2012 15:47:44 ERROR com.nakisa.Logger  - BAPI_SAP_OTFProcessor_LinkedDataElement : while trying to invoke the method com.nakisa.framework.data.Command.getType() of an object loaded from local variable 'p_cmd'
    26 Jun 2012 15:47:44 ERROR com.nakisa.Logger  - com.nakisa.framework.webelement.charting.data.ChartingData : createNodesFromData : Notes Error: NullPointerException
    26 Jun 2012 15:47:44 ERROR com.nakisa.Logger  - BAPI_SAP_OTFProcessor_LinkedDataElement : The dataelement ( SAPPositionVacancyDataElement ) is not defined.
    26 Jun 2012 15:47:44 ERROR com.nakisa.Logger  - BAPI_SAP_OTFProcessor_LinkedDataElement : while trying to invoke the method com.nakisa.framework.data.Command.getType() of an object loaded from local variable 'p_cmd'
    26 Jun 2012 15:47:44 ERROR com.nakisa.Logger  - com.nakisa.framework.webelement.charting.data.ChartingData : createNodesFromData : Notes Error: NullPointerException
    26 Jun 2012 15:47:48 ERROR com.nakisa.Logger  - com.nakisa.framework.webelement.charting.data.ChartingData : createNodesFromData : Notes Error: NullPointerException
    26 Jun 2012 15:47:55 ERROR com.nakisa.Logger  - BAPI_SAP_OTFProcessor_LinkedDataElement : The dataelement ( SAPPositionVacancyDataElement ) is not defined.
    26 Jun 2012 15:47:55 ERROR com.nakisa.Logger  - BAPI_SAP_OTFProcessor_LinkedDataElement : while trying to invoke the method com.nakisa.framework.data.Command.getType() of an object loaded from local variable 'p_cmd'
    26 Jun 2012 15:47:55 ERROR com.nakisa.Logger  - com.nakisa.framework.webelement.charting.data.ChartingData : createNodesFromData : Notes Error: NullPointerException
    At the very least it looks like SAPPositionVacancyDataElement is missing and whilst the other errors around it are unfamiliar I wonder if it might be a good first step to see if you can track down the reference to and existence of this data element?  That being said it looks like your last test occurred well over an hour after this (so you may have already resolved it) and resulted in nothing but information messages.  If that is the case it might be worth "rolling" your log file or manually trimming it to the right time frame when posting it?  Otherwise it can be misleading as people could flag up issues you have already resolved.
    So assuming you haven't tried Luke's suggestion (which should only take a couple of minutes to do) I think you should go back and do so right away .
    Regards,
    Stephen.

  • Do Get-Set methods break encapsulation?

    Some of my mates, who have been programming more time than me, say tha if you have a private variable which is accesible v�a two public methods "get" and "set" this breaks the encapsulation principle, and is equivalent to do the variable public, as anybody can read or modigy thge variable.
    I disagree, I think that two public get set methods still hide the implementation, you can acces directly to the variable, and so don't break the encapsulation principle.
    Can anybody tell me if I or them are right?

    As everybody else in the thread has indicated, accessors do not
    necessarily break encapsulation. However, I do not think the situation is as
    cut and dried as everybody seems to be making out.
    Accessors (by definition?) provide a mechanism to safely modify the member data of an object. Generally accessors match 1:1 the member data of an object (at least initially). By looking at accessors it is generally possible to make some good guesses about what member data an object contains. Which is a Bad Thing(TM). Of course, over time, accessors may reflect underlying implementation less and less accurately (which is when they become useful).
    Many years ago when I started OO programming, most "accepted" wisdom was that methods should represent object behaviour. For this reason, accessors were generally deemed to be a bad thing, and led to poorly encapsulated objects (since they do not really model behaviour; if you fill your car's petrol tank with petrol (gas? :>), "car.fillTank()" is preferred to
    "car.setCurrentTankVolume(car.getMaxTankCapacity())" in this mindset.
    The first defines object behaviour, and is safe, the second uses accessors to perform the same task (and is also pretty safe, but far less expressive).
    Generally I'd avoid accessors if only on the argument of them making code less clear and self-documenting, but that's a personal viewpoint.
    Another way to look at it is that accessors as most people view them are implemented after the member data has been defined; I prefer to break my object behaviour down first, define methods, and then define member data as needed to support the behaviour my object will exhibit.
    I certainly use accessors; a bank balance object is highly likely to have a "getBalance()" method. It's less likely to have a "setBalance()" object (very few people ever go into a bank and "set their balance". They always "make deposits" or "make withdrawals". They do, however, often "get their balance"). But my member data is derived from the object behaviour (including these "accessors") rather than vice versa. Are these "accessors" still "accessors"? A "setBalance()" method might be useful if the balance object is stored in a database so the database layer can populate it - but this is a design decision that should be taken in a measured way rather than "I have a balance member, let's add accessors".
    My guess is you would say "yes", whereas your friends would say "no"!

  • The ringer setting is not working on my iPhone 4s

    My iPhone fell into my pond for less than 10 secs. I pulled it out in time to dry it off and shake some of the water out. I made sure the screen was still working and sounds were functioning then I turned it off and left it in a bag or rice for 24 hrs. The next day I took it out and it was working fine. Now suddenly today, the ringer setting is not working. When I go into settings>sounds I press on ringtone and it seems to be working. Speakers are fine and when someone calls I have no problem. I can also hear the ringtones. But when someone txts me or when I get notifications it doesn't have any sound? The alarms don't work and the sounds in apps don't work. When I put the charger in, it doesn't make a sound. It vibrates only except when someone calls me... My headphone jack seems to be working fine because I can hear everything even the text tones and sounds in apps... What should I do? How much will I have to pay to get someone at apple to fix this problem? I'm assuming there is still some moisture in the phone maybe? It was working for a week until today I'm not planing to upgade to the iPhone 5 anytime soon. Btw, the volume buttons do work it's just when I press on it, it doesn't show the bars when you press up or down... it's just blank.

    If it's physically stuck it might be best to bring it into the Apple store at George Street Sydney.
    Set up an appointment with the Apple store via the website http://www.apple.com/au/support/contact/

  • Setter method not getitng called in the custom tag

    Hi,
    I have written a custom tag and I have declared an attribute in the tld file and have specified the setter method for the same in the java tag file but that setter method is not getting called...for rest of the attributes, the methods are getting called and not just for one!! any idea what could be the problem....
    Regards
    Deepak Saini

    Do you have a getter method to match that property?
    Post some example code - what does your tld define for this property, and what get/set methods have you defined for it?

  • HT201269 one fine day, my i phone just hangup lost all contact detail. The screen only show a picture depicting cable connection to iTune. I have tried to restore iphone to factory setting but not working .  May i know how to proceed to recover lost conta

    one fine day yesterday, my i phone just hangup lost all contact detail. The screen only show a picture depicting cable connection to iTune. I have tried to restore iphone to factory setting but not working .  May i know how to proceed to recover lost contacts.

    I have taken it back to the Apple store genius bar, but they say they don't see anything wrong. Well unless you use it all day and experience the problems when they happen, you wont see anything wrong. But there are lots wrong with it. But this would be the same store as I purchased the phone. And they backed up my old Iphone 4, but were not able to get anything to load back onto my new phone. So, I lost pretty much everything. But over time, some of my contacts have started showing up, although i am still missing over 800 of them.

  • Change the properties of a field dynamically using Getter/Setter methods

    Thanks
    Raj
    Edited by: RajICWeb on Aug 12, 2009 4:31 AM

    Hi Harshit
    Thanks for the reply. Like you suggested, I redefined the get_i_zfield( ) method. But the program is not going through this method.
    FYI.....I created the getter/setter methods manually for my zfield. Plz let me know if I am missing anything. Your help will be greatly appreciated.
    Below is my requirement:
    I need to add an additional column (zfield) to a tree view. The name of the component is BTRESTREE. (there is only one view in this component- this view is having only one context node).
    I tried adding my zfield to the attributes (of the context node) through the wizard by right clicking on the 'Attributes'. But I am not getting the 'Create' Option.
    I posted a thread few days back regarding the same problem. One of the experts (Vikash Krishna) suggested me to add some my zfield by redefining the 'GET_TABLE_LINE_SAMPLE' method. As per his suggestion, I was finally able to see my zfield in
    the configuation tab.
    Now, I have to change the properties of my zfield (make this column editable) in the tree view. For that, the only option that I can see is to change the get_i_zfield( ) method (here we have 'rv_disabled') for my zfield. For this, first I need to add my zfield to the Attributes. To achieve this, I added getter/setter methods manually in the Proxy class.
    Thanks
    Raj

  • How do i make a tab active and make it stay that way always. If i put a website in my home page in order for the tabs to open automatically in that same homepage , this setting is not working, every time I open a tab , a white window appears .

    How do i make a tab active and make it stay that way always. If i put a website in my home page in order for the tabs to open automatically in that same homepage , this setting is not working, every time I open a tab , the window appears white .

    By default Firefox opens a blank page for a new Tab, there is no setting to change that action without installing an add-on.
    New Tab Homepage extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/777

  • I have just installed iTunes for the first time. When I run the application I get a "iTunes not working" message. Operating system Vista (32 bit). I have tried reinstalling with all firewalls off, but still no success. Have other people had this problem?

    I have just installed iTunes for the first time. When I run the application I get a "iTunes not working" message. Operating system Vista (32 bit). I have tried reinstalling with all firewalls off, but still no success. Have other people had this problem?

    Drrhythm2 wrote:
    What's the best solution for this? I
    Copy the entire /Music/iTunes/ folder from her old compouter to /Music/ in her account on this new computer.

  • After Method not work

    Hello guys,
    I need your help.
    In activity step I added one method in "Methods AFTER Work Item Execution (Modal Call)", but this method not work after complete the workitem.
    This method run in background, and insert data in one table.
    My workflow use BUS1001006 object type, and this method too.
    Any idea?
    Thanks!!!
    Kleber

    Hi Arghadip!!!
    Now it's work fine!!! Thanks!!!
    Please... more one question...
    In my method, I need the value of the element <b>_Workitem.WorkitemStatus</b>.
    It's possible:
    ===========================================================
    swc_get_element container '<b>_Workitem.WorkitemStatus</b>' vl_status.
    ===========================================================
    or
    ===========================================================
    swc_get_element container '<b>_Workitem-WorkitemStatus</b>' vl_status.
    ===========================================================
    How I do this?
    Thank a lot!!!
    Kleber

  • I keep getting "Applephotostream.exe" not working on my pc.   How can I fix or reset?

    I keep getting "Applephotostream.exe" not working on my pc.   How can I fix or reset?

    My Vista Home Premium  System Type is a 64 bit Operating System.
    I was hoping that someone in the Apple Community would have a solution.
    Still waiting.
    Thanks for your response.  Keep checking back.

  • Get mail button not working can not receive any mail

    Hello
    my mail stops working half way. I can sent messages but suddenly my get mail is not working anymore. not through the button and not through the mailbox menu.
    any help
    regards

    Who is your ISP, how is your mail configured - POP or IMAP and do you get any error messages and if so what are they?

Maybe you are looking for

  • How do i change an apple id on an iphone 4 but keep my contacts and calendars in the process?

    Hi ive had 2  iphone 4's under the same apple id for the past yr. One phone is my fathers and the other phone is mine. I want to create an apple id for my dad and change his apple id on his iphone but keep his contacts and calendars. Can that be done

  • Problem when login to Visual Administrator

    Hi all, Here is a problem while login into visual administrator.when i run go.bat file it is throwing a syntax error. So,can anyone suggest me how to resolve. As i need to active the services to run AE for Netweaver PI. Thanks, Kalyan.

  • Licensing with Smart Forms

    Are Smart Forms included as part of the standard SAP licensing agreement if my client has purchased SAP ERP?  Does this apply even when I create my own custom Smart Form?  We are investigating the decision criteria of when to use Smart Forms vs. Adob

  • RH7 WebHelp doesn't do Fields??

    Hi - I was just reading the RH7 documentation (we're still evaluating apps) and I found something that I need clarification on. I'm pretty sure that WebHelp is the output we need to use because no files or DLLs can be stored on the users computer whi

  • Working with daynamic values

    -Hi, i had FM with import value type any that can be type of 5 structure, and in the fm i need to do insert to DB tables( i have 5 related db tables), my question is if from the value that i get(the structure name)  in the import parameter i can know