getInt() in java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pralu
    New Member
    • Mar 2008
    • 34

    getInt() in java

    what getInt() do???

    buffer.getInt()
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by pralu
    what getInt() do???

    buffer.getInt()
    Post all the relevant code using code tags. Also tell us what you think getInt() does.

    Comment

    • pralu
      New Member
      • Mar 2008
      • 34

      #3
      i think getInt() returns 4 bytes ....n increment the position by 4 bytes in its buffer

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by pralu
        i think getInt() returns 4 bytes ....n increment the position by 4 bytes in its buffer
        What is buffer?

        Comment

        • pralu
          New Member
          • Mar 2008
          • 34

          #5
          Originally posted by r035198x
          What is buffer?
          buffer is a temporary storage place

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by pralu
            buffer is a temporary storage place
            So, are you going to post your code or not?

            Comment

            • chaarmann
              Recognized Expert Contributor
              • Nov 2007
              • 785

              #7
              Originally posted by pralu
              buffer is a temporary storage place
              We know that already. But we need the class name of the object "buffer". So we can see what the method getInt(0) is doing.
              For example "buffer" could be an object of class "ResultSet" . Then it would return the integer value of the stored table column via JDBC.

              Comment

              • pralu
                New Member
                • Mar 2008
                • 34

                #8
                Originally posted by r035198x
                So, are you going to post your code or not?

                no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........

                Comment

                • r035198x
                  MVP
                  • Sep 2006
                  • 13225

                  #9
                  Originally posted by pralu
                  no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........
                  Without the code, no one can tell what getInt does because the answer depends on which class getInt is in.
                  Example
                  [CODE=java]class A {
                  public A() {
                  }
                  public String getInt() {
                  return "going around in circles";
                  }
                  }[/CODE]

                  Now
                  [CODE=java]A buffer = new A();
                  System.out.prin tln(buffer.getI nt());[/CODE]
                  As you can see my getInt is very much different from your getInt().

                  Comment

                  • JosAH
                    Recognized Expert MVP
                    • Mar 2007
                    • 11453

                    #10
                    Originally posted by pralu
                    no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........
                    Ok, if you're not going to tell us what the type (class) of 'buffer' is any guess is as
                    good as the other; my guess: toInt() first makes daemons fly out of your nose and
                    then Meryl Streep will hound you for the rest of your life while you turn purple and
                    your privvy parts will shrink beyond regular proportions while singing the Out of
                    Africa title song which makes the bytes in your computer laugh at you which in
                    turn will make Meryl Streep even angrier.

                    kind regards,

                    Jos

                    Comment

                    • pralu
                      New Member
                      • Mar 2008
                      • 34

                      #11
                      Originally posted by JosAH
                      Ok, if you're not going to tell us what the type (class) of 'buffer' is any guess is as
                      good as the other; my guess: toInt() first makes daemons fly out of your nose and
                      then Meryl Streep will hound you for the rest of your life while you turn purple and
                      your privvy parts will shrink beyond regular proportions while singing the Out of
                      Africa title song which makes the bytes in your computer laugh at you which in
                      turn will make Meryl Streep even angrier.

                      kind regards,

                      Jos
                      nice answer jos..... but its something very critical which i cant....
                      ok i will give u that portion

                      Comment

                      • sukatoa
                        Contributor
                        • Nov 2007
                        • 539

                        #12
                        Originally posted by pralu
                        no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........
                        Where did you get that buffer.getInt() ?

                        From the book? from your friend?from the office? from the internet? Where?

                        If you don't show the code, they don't show also the answer....

                        Maybe you are looking in this article,

                        If that is not,

                        maybe you are trying to be convinced.... and also trying to derive it to them...
                        And explains it all for you just like what my instructor are doing....

                        regards, ;-)
                        sukatoa

                        Comment

                        • pralu
                          New Member
                          • Mar 2008
                          • 34

                          #13
                          Originally posted by pralu
                          nice answer jos..... but its something very critical which i cant....
                          ok i will give u that portion



                          EventLogHeader header;
                          header.setNextI ndex(buffer.get Int());

                          and in the above code EventLogHeader is the class and in that class they have mentioned it like this:


                          public int getNextIndex() { return (int)nextIndex; }
                          public void setNextIndex(in t nextIndex) { this.nextIndex = (long)nextIndex & ClientData.MASK _U32; }

                          Comment

                          • r035198x
                            MVP
                            • Sep 2006
                            • 13225

                            #14
                            Originally posted by pralu
                            EventLogHeader header;
                            header.setNextI ndex(buffer.get Int());

                            and in the above code EventLogHeader is the class and in that class they have mentioned it like this:


                            public int getNextIndex() { return (int)nextIndex; }
                            public void setNextIndex(in t nextIndex) { this.nextIndex = (long)nextIndex & ClientData.MASK _U32; }
                            That is not the relevant code. Where is buffer declared and initialized?

                            Comment

                            • chaarmann
                              Recognized Expert Contributor
                              • Nov 2007
                              • 785

                              #15
                              Originally posted by JosAH
                              my guess: toInt() first makes daemons fly out of your nose and
                              then Meryl Streep will hound you for the rest of your life while you turn purple and
                              your privvy parts will shrink beyond regular proportions while singing the Out of
                              Africa title song which makes the bytes in your computer laugh at you which in
                              turn will make Meryl Streep even angrier.

                              kind regards,

                              Jos
                              Wow! That's awesome what your getInt() function is doing. Better than going around in circles. Can you send me the source code of this function over? I need to send it to a "friend". He once got very angry that I did a bad thing to him. I asked, what thing, and he said, somebody told him, but he doesn't want to repeat it, I should know by myself what I did. I askd him, who told you, and he said, he doesn't want to tell me the name of his informant, because he has promised him to keep his name secret. So he asked what will I do now? I told him I don't know of anything bad that I did to him, and he got angry and told me a liar, he can see the smirk in my face. I should at least be sorry and admit it.
                              So I said, whatever bad I have done to you, I feel sorry. That calmed him down, but I never figured out what it was.

                              Comment

                              Working...