Created a class...

I created this class on paper and I dont have access to a computer that I am able to test it on. But from what I can see it seems that it is correct and should work according to what the function descriptions say and I was just wondering if any of you could spot some errors?
Thanks
public class Event implements Comparable {
     private boolean arrDep;        //1 = arrival 0=departure
     private int eventTime;
     private int eventLength;
      * Constructor used to create a new arrival event
      * @param time the time the arrival occurs
      * @param length the length of the transaction
     public Event(int time, int length)
          arrDep = true;
          eventTime = time;
          eventLength = length;
      * Constructor used to create a new departure event
      * @param time the time the departure occurs
     public Event(int time)
          arrDep = false;
          eventTime = time;
          eventLength = 0;
      * Returns the time that the event occurs
      * @return the time of the event
     public int getTime()
          return eventTime;
      * For arrival events, returns the length of the transaction
      * For departure events, returns 0
      * @return the length of the transaction
     public int getTransLength()
          return eventLength;
      * Used to determine if the event is an arrival event
      * @return true if the event is an arrival, and false otherwise
     public boolean isArrival()
          return arrDep;
      * Used to determine if the event is a departure event
      * @return true if the event is a departure, and false otherwise
     public boolean isDeparture()
          return !arrDep;
      * Used to determine which event will happen first
      * @return 0 if this.getTime() == rhs.getTime()
      *        -1 if this.getTime() <  rhs.getTime()
      *         1 if this.getTime() >  rhs.getTime()
     public int compareTo(Object rhs) {
          if(this.getTime() == ((Event) rhs).getTime()) return 0;
          else if(this.getTime() < ((Event) rhs).getTime()) return -1;
          else return 1;
}

Your In the Clear
everything complies perfectlydon't be mean, no it doesn't >-)
@OP, it probably does compile, I haven't tried. looks ok. but your question raises a few interesting points
1) can you trust total strangers to answer this honestly? would it matter? only way to know whether something will work is to try it yourself, and since you can't do that at the moment, there can be no consequences to any answer you get
2) what use would even an honest answer be? suppose we all agreed on "no". then what? you re-write it? why? you can't use it. if we all agree on "yes"? so what? you have some source code on paper that will compile, finally, when you get to a machine, at which point you can find out for yourself anyway :-)

Similar Messages

  • How to create proxy class for a Siebel WS which has many Workflows in it?

    Hi,
    I am facing a strange problem. I have a Web Service for which there are many workflows associated with this. When I generate WSDL for this Web Service and later on generate proxy class in .NET, it creates mutilple classes for each workflow. From UI, I can invoke a perticular method for the class for which I am interested in. But when I am building the same in JDeveloper, using Web Service proxy, I get only one class and I am not interested in invoking method in this class but interested in some other class for which the proxy was not generated. Is there some way to generate multiple classes in JDeveloper proxy?
    Thanks,
    Sudha.

    I have figured this out. Actually Generate proxy creates package and it includes all the class in it. Now i am able to invoke web service method call.

  • How to create a class using java script..

    Hi all,
    Iam new to java script and I tried out the following program but its not working..I basically created a class just like a java prog' but Iam not getting any output or error.Iam attaching the code below.
    If I created one function inside the script and create one object its working fine but what should I do when I have a lot of function??so I created a class and put all the function and created an object but its not working..
    Do let me know what changes should I do..Iam attaching the code which I had written. or give me an example of how to create a class with couple of functions using JAVASCRIPT
    Thanks
    Avis_su
    <html>
    <head><title>JSP Page</title></head>
    <body>
    <SCRIPT language = "JavaScript">
    <!--
    //Created classes
    class book
    var title: String;
    var author:String;
    function author()
    doucument.write("Author is " +this.author);
    function tile()
    doucument.write("Title is " +this.title);
    function printall()
    var counter = 0;
    function author();
    function title();
    var chapters = Array[String];
    for(chapter in this chapters)
    counter++;
    document.write("Chapter" counter" :"+this.chapters[chapter]+"<br>");
    var thisbook = new book()
    thisbook.author = "Sivagami";
    thisbook.title = "MS in CS giude";
    thisbook.chapters = new Array[10];
    thisbook[0] = "Prepare to Excell in all ";
    thisbook[1] = "Learn to be happy";
    thisbook[2] = "Learn to be healthy mentally emotionally physically";
    thisbook[3] = "Siva and Subbu along with kidssssss will be successful in future";
    thisbook.printall();
    //-->
    </script>
    </body>
    </html>

    Run this program to get your answer:
    public class AnswerToYourPost {
    public static void main(String args[]) {
    System.out.println("TRUE/FALSE: This question
    ion belongs on a Java forum.\n"
    + "ANSWER: " + ("Javascript" == "Java"));
    }Since when do we compare objects for equality using operator == ?

  • How to create Development Class in SAP R/3 4.7c and Netweaver?

    I follow some old notes on ABAP Development Class but I could not create a new Development Class. i.e. Stuck in creatinf a type group.  Please give some details on how to create a development class.  Thanks.
    see the following stepa:
    (A) Procedure for creating  a type group:
    /nse80
    1. Object Navigator> select Development class>(Enter your development class
       yFTGxxDEV
    2. Double click on development class object types.
    3. Type Group: zPTAxx1.
    4. Click on the Create button at the bottom (4th one from the left).
    5. Enter short text: zPTAxx1 type group.
    6. Save>Enter your development class> click on diskette button to save the type group
    7. Select Source Code tab and enter the following:
    "An example type-pool statement containing types and constants
    type-pool zxx1.  "zxx1 is a type pool. It is also known as a type group
    types: zxx1_dollars(16)    type p decimals 2,
                 zxx1_lira(16)          type p decimals 0.
    constants:
           zxx1_warning_threshold type i value 5000,
           zxx1_amalgamation_date like sy-datum value '19970305'.
    8. Select  Type Group from menubar
               a) Check
               b) Save
               c) Activate
    9. Click the back button or F3 to exit.
    10, Show  your type group to your teacher.
    11. Go to ABAP editor and enter the following program:
    "Calculations on date
    report zxx_0914.
    type-pools zxx1.                   "contains zxx1_amalgamation_date
    data:    d1              like sy-datum,
                d2              like d1,
                num_days type p.
    d1  = d2 = sy-datum.
    subtract 1 from d1.
    write / d1.                              "yesterday's date
    d2+06 = '01'                         " first day of current months
    subtract 1 from d2.
    write / d2.                           " last day of previous month
    num_days = sy-datum - zxx1_amalgamation_date.
    write / num_days.                " number of days since amalgamation
    11. Double click zxx1 from the type-pool statement to see the type group.
    12. Follow lab1 procedure and run your program
    (B) Run an ABAP program using field symbol ( i.e. pointer)
    report zxx_lab6.
    data  f1(3)  value   'ABC'.          "Step 1 Define a variable
    field-symbols <f>.                     "Step 2 Define a pointer variable ( it only stores address)
    assign f1 to <f>.                        "Step3 Initialize the pointer variable with an address
    write <f>.                                    "Step4 Now you can use <f> in place of f1
    write / f1.                                      " (same as write f1 )  
    <f> = 'xyz'.                                   " Assign a new value to f1
    write <f>.
    write / f1.

    This is not the way to create a new development class.
    Follow this steps to create a development class:
    http://sap.mis.cmich.edu/abap4/knowbase/Create-Dev-Class.pdf
    Regards,
    Naimesh Patel

  • Error Occured While Creating message class 8II In SapNote 1486147

    Dear All
    I applied SapNote 1486147 but at the time of creating message class 8II
    It shows error like this
    Object MSAG 8II is in reserved name range for sap partner
    Any body help on this.
    Edited by: chandrap on Feb 24, 2011 2:08 PM

    Hi Yasir,
    remove the jaxb.jar from the WEB_INF/lib and move
    them to your SUNWappserv/lib/endorsed - dir, together
    with the following jars:
    dom.jar jaxb-api.jar jaxb-impl.jar jaxb-libs.jar
    jaxb-xjc.jar namespace.jar relaxngDatatype.jar
    r xalan.jar
    xercesImpl.jar xsdlib.jar
    (restart the deploytool if used)
    This should work,
    Bas van OudenaardeHi Bas
    Thank you for the very useful tip but I don't seem to have a SUNWappserv/lib/endorsed - directory inside my .war archive , could you please advise on this issue

  • Error While Creating Asset Class

    Hi Friends,
    I am getting the following error in development client while creating the asset class AB2200.
    "Screen Layout 200 was not created"  but the same was created.
    Please guide me how to handle this error and the reason for me getting this error message while creating asset class.
    Your quick response would be highly solicited.
    Thanks and Regards,
    C.R.Srinath

    Hi Srinath
    There are 2 things.. Create the screen layout and Define the screen layout... (IMG> AA > Master Data> Screen Layout for asset classes)
    Complete both the steps here and specify the same sccreen layout in your asset class
    Regards
    Ajay M

  • Error while creating model classes, operation aborted in NWDS

    Hi All,
    When i select Adaptive rfc 2 model  and then search for the RFC,  when i select RFC and click on next i get an error while importing :
    Error while creating model classes, operation aborted.
    It is working fine in visual composer and i have activated function module, RFC but getting same error. It is also working in web service navigator also.
    Can any one help me out??
    Regards,
    Pradeep kumar
    Edited by: pradeep_546 on Feb 17, 2011 9:35 PM
    Edited by: pradeep_546 on Feb 17, 2011 9:36 PM
    Edited by: pradeep_546 on Feb 17, 2011 9:37 PM

    Hai guys thanks for reply
    Tushar,
    I am using NWDS 7.2, ce7.2 server, ECC 6.0.
    Amit,
    I have tested the JCO destinations they are working fine and i created a new pair of JCO destinations but unable to import the Adaptive RFC2 Model gives same error but Adaptive webservices are working fine in my NWDS7.2
    Deepak,
    I am unable to create model in other projects also.
    I have sufficient amount of memory in my drive.
    I have imported the DC to other NWDS but it gives same error.
    Thanks for all,
    Regards,
    Pradeep Kumar G
    Edited by: pradeep_546 on Feb 18, 2011 3:05 PM

  • Error in creating a class.

    Hi Experts,
    While creating a class for the created interface..
    I am getting following error.
    "IT_MARA" is not an internal table - the "OCCURS n" specification is missing.
    Please correct the error.
    method Y_IF_INTERFACE~SELECT_METHOD .
    SELECT * FROM MARA INTO TABLE IT_MARA
             WHERE MATNR BETWEEN P_MATNR_LOW AND P_MATNR_HIGH.
    endmethod.
    Regards
    nani

    The code is like this
    tables: mara.
    *provide mara table
    DATA: zMARA TYPE MARA.
    *provide data objects
    DATA: OBJ TYPE REF TO Y_CL_INTERFACE,
          IT_MARA TYPE standard table of MARA with header line,
          WA_MARA TYPE MARA.
    *provide selection screen
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    *provide object
    START-OF-SELECTION.
      CREATE OBJECT OBJ.
    *call the method.
      CALL METHOD OBJ->Y_IF_INTERFACE~SELECT_METHOD
        EXPORTING
          P_MATNR_LOW  = S_MATNR-LOW
          P_MATNR_HIGH = S_MATNR-HIGH
        IMPORTING
          IT_MARA      = IT_MARA
          WA_MARA      = WA_MARA.
    *display the data
      LOOP AT IT_MARA INTO WA_MARA.
        WRITE:/ WA_MARA-MATNR,
                WA_MARA-ERSDA,
                WA_MARA-ERNAM,
                WA_MARA-MATKL,
                WA_MARA-MEINS.
      ENDLOOP.
    Regards
    Nani

  • Message while creating a class method

    Hi all,
    I have created a class as local object. When i try to modify that class the following message is displayed.
    "You are not authorized to make changes (authorization object S_DEVELOP)"

    Click [here|http://help.sap.com/saphelp_40b/helpdata/EN/27/174b6e5733d1118b3f0060b03ca329/content.htm] to know about s_develop authorization object.
    and Please ask your BASIS Team or Security Admin to get the Change Authorization to your User
    ID/Profile.

  • Help Needed in Creating Java Class and Java Stored Procedures

    Hi,
    Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database.
    I have seen the Documents. But i couldn't able to understand it correctly.
    I will be helpful when i get some Examples for creating a Java Class, Java Source and Stored Procedures with Java with details.
    Is that possible to Create a Java class in the oracle Database itself ?.
    Where are the files located for the existing Java Class ?..
    Help Needed Please.
    Thanks,
    Murali.v

    Hi Murali,
    Heres a thread which discussed uploading java source file instead of runnable code on to the database, which might be helpful :
    Configure deployment to a database to upload the java file instead of class
    The files for the java class you created in JDev project is located in the myworks folder in jdev, eg, <jdev_home>\jdev\mywork\Application1\Project1\src\project1
    Hope this helps,
    Sunil..

  • Creating A Class For A ComboBox Component

    I have a comboBox component that I would like to create a
    class for. But I am not sure if I could. I see how you can use the
    Linkage window to assign an AS 2.0 Class to a movie clip, but I do
    not see that same option for a comboBox component.
    It has all of the basic combo box things that I would like to
    seperate out into it's own class if possible
    If anyone could give me a few tips, or better yet, point me
    to a few good tutorials, that would be great.
    Thanks
    Mathias

    I have a comboBox component that I would like to create a
    class for. But I am not sure if I could. I see how you can use the
    Linkage window to assign an AS 2.0 Class to a movie clip, but I do
    not see that same option for a comboBox component.
    It has all of the basic combo box things that I would like to
    seperate out into it's own class if possible
    If anyone could give me a few tips, or better yet, point me
    to a few good tutorials, that would be great.
    Thanks
    Mathias

  • Dynamically create a class based on database tables

    I am trying to build a database and tables on the fly, and save to the harddisk(done). Then I need to create a class using the info from the tables on the fly.
    For example,
    I built a database BANK, and a table Customer,
    Customer
    ID
    Phoneno
    Address
    Could I create a class named CUSTOMER (table name)
    dynamically, and have ID, PHONENO, ADDRESS,as the attributes of the class?
    Could anyone help or show the direction?
    Cheers.

    You could use a HashMap, and use the String keys "Customer", "ID", etc, and if you have primitive values like an int, you just wrap it inside Integer or any of the other wrapper classes, because HashMap only works with objects.
    Then you can use an ArrayList to hold all the records (one record is one HashMap as described above).

  • Fastest way to create child class from parent?

    As the subject states, what do you folks find is fastest when creating child classes directly from the parent? (esp. when the parent is in a lvlib) I thought I'd post up and ask because the fastest way I've found to get working takes a few steps.
    Any suggestions ae appreciatized!
    -pat

    Thanks for the quick response Ben!
    Yea, I apologize, in your response I realize my OP was more than vague haha (it hapens when you get used to your own way of doing things I guess huh)- I'm trying to create a child from a parent so that it has all of the methods that the parent has.
    In order to do so I currently have to open and close LV a few times during my current process so that vi's in memory dont get mixed up- Currently I save a copy of the parent class in a sub dir of where it is saved, close out of LV, open the new 'copy of parent.lvclass', save as>>rename 'child class.lvclass', close LV, and open up the project to 'add file', then right click>>properties>>inheritance.
    Is this the only way to do this?
    Thanks again!
    -pat
    p.s. I'm tempted to steal your cell phone sig, hope you dont mind haha good stuff!

  • Can I create private class in ABAP?

    Hi all,
    Can I create private class in ABAP? Please reply me its interview question.
    Thanks ,
    Vishal
    Moderator message : Interview type questions not allowed, read Forum Rules Of Engagement before posting.  Thread locked.
    Edited by: Vinod Kumar on Jan 16, 2012 12:20 PM

    Vishal , please read the rules of this forum.

  • How to create a class pool

    Hi how to create a class pool when i tried to create it has shown the following error
    <b>Unable to change program from or to type K
    Message no. DS165
    Diagnosis
    You tried to assign a type to a program that cannot be assigned in the program attributes, but can only be set internally by one of the tools in the ABAP Workbench.
    The following program types are reserved:
    F Reserved for Function Groups
    Function groups are adminstered by the Function Builder, and you can only create or delete them using the Function Builder or the Object Navigator (Transaction SE80).
    K Reserved for Class Defintions
    Class definitions are administered in the Class Builder. You can only create or delete them using the Clas Builder or the Object Navigator.
    J Reserved for Interface Definitions
    Interface definitions are administered in the Clas Builder. You can only create or delete them using the class Builder or the Object Navigator.</b>

    Hi,
    Though you get a popup for different options for different program types like Class pools, function groups etc in SE 38 Program attributes, you can't create them from Se38 transaction.
    They have to be created from different places.
    Class Pools are nothing but creating CLASSes and INTERFACEs using the T Code SE24.
    This needs little Java/OOPs concepts to create and use them.
    Hope this helps.
    Regards,
    Anji

  • Creating a class library in VS2013 that can be referenced by a VB6 application and newer applications

    I need to create a class library in VS2013 that can be referenced by a VB6 application and newer applications. I heard something about
    COM Interop but have no idea where to start. I am assuming I would develop a class library in VS2013 and then package the assembly for COM. Any good sample projects on this out there?

    Hello,
    >> Any good sample projects on this out there?
    Not suer if you are using C# as the develop language, if it is, i think you would find a lot of articles about this topic with your favorite search engine, here are some related links:
    COM Interop Part 1: C# Client Tutorial
    COM Interop Part 2: C# Server Tutorial
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • IMovie is not showing up on iPod

    I downloaded an iMovie, and it shows up on iTunes, but when I sync my iPod, it isn't there. I haven't had any trouble with tv shows???

  • Downpayment Clearing - Vendor

    Hi I am stuck with an error at the time of downpayment clearing made to an asset in Transaction F-54. When I execute F-54 for clearing a downpayment, I am seeing the downpayment line item existing.  But when I select that item and simulate it for pos

  • Nokia N97 mini isync plug request start here (Ooop...

    So I can't believe I can't sync my contacts and calendar on my mac with my brand new phone when I could do it without problems with my good ol' E65. Anyone by luck have any info on a release date or should I switch back to good ol'E65?  If you feel a

  • Why does the Apple mouse drain so quickly?

    I'm not sure if this question is in the right place. I bought a iMac back in January and I've been changing the batteries like every few weeks. My question is why does the mouse drain so quickly? The batteries in the keyboard have been in there since

  • How do I join two songs on separate tracks on Garage Band for the MacBook Pro?

    I have two songs on two separate tracks that I'm trying to join into one. I highlighted both, but when I select edit, "join" isn't an option.