SortedVector with Objects???

Can you use a SortedVector with objects? I have browsed the forums and every time someone uses this they insert a string or int. Here's my senario...
I have a vector of objects (mailboxItems that contain header information for each entry) and I need to sort the information based on the messageDate.
I'm fairly new to Java, so feel free to point out the obvious.
Thanks!

I am following, but I have two questions:
1. If I implement the object as comparable then how do
I determine which field to sort by?The choice is yours as the implementor
>
2. I understand the concept of overriding the equals
and hashCode, but why am I doing this? Oh yeah, and
could you point me in the right direction as to what I
would change in there?So when you put them in sorted sets, they get fairly evenly distributed into hashbins - which will give you better performance than saying, setting the hashcode to 17 for all objects. The latter is valid, but leads to inefficient code.
>
BTW, thanks for the link, very helpful.
Thanks for the fast responses everyone!

Similar Messages

  • BAPI_OBJCL_CHANGE error: valuated with object dependencies

    Hi expert,
    having programmed an extension for a customer for automatic maintenance of characteristic values of technical object, we have come across an error.
    When using BAPI_OBJCL_CHANGE to change a characteristic followed by BAPI_TRANSACTION_COMMIT (without wait) we have two scenarios:
    1. if the technical object has no value in the characteristic before calling  BAPI_OBJCL_CHANGE  the characteristic will be set.
    2. if there is already a value set there is an error stating
    Characteristic 'XYZ' valuated with object dependencies (old value '00')
    However, I can't find a dependency definition in CT04. do you know what's wrong here,or what is a usual cause of that?
    thanks
    Stefan

    Hi,
    Please see the given link, It may help you.
    Re: BAPI_OBJCL_CHANGE and BAPI_TRANSACTION_COMMIT
    Regards,
    Shamma

  • PDS Creation with Object Dependency

    Hello Gurus,
    I´ve written a function to run BAPI_PDSSRVAPS_SAVEMULTI in order to create PDS with object dependency (Super BOM). The PDS created by my function looks good in CURTO_SIMU, but it is not respecting the characteristic dependency during PPDS Heuristic. If I take a PDS generated in ECC with the exact same attributes, the heuristics explodes the components correctly. When I run the getlist bapi, it shows both ECC created and function created with all tables (pds_header, pds_component,) filled with the same content. Though, one PDS works and the other doesnt. I am clueless.
    thank you a lot.
    Cheers
    Rafael

    Mainly due locking issues. Added some logic to wait.

  • Batch input with objects

    Hi,
    Exists a standard class to develop a batch input????
    Any ideas???
    Is it possible to create a batch input with objects??

    Hi there
    Why not
    just define your class in the normal way
    decide what variables you need to pass
    in the methods of your class call the fm modules bdc open, bdc dynpro etc etc.
    Incidently the following include will have a decent amount of code for the BDC bits.
    include bdcrecx1.
    A good way is to start sm35 to record what you are doing on the screen. When you've finished  go to your recording in SM35 and click on CREATE PROGRAM - it will create most of the code for you including the screen fields -- you'll need to edit a bit of course as you don't need everything that will be shown.
    Debugging in the CREATE PROGRAM might show you a decent generic way of generating BDC's which you could easily do via a class.
    Note however using BDC's is the LEAST PREFRERRED WAY of performing work and should only be used as a LAST RESORT if there really is no other way. A lot of new BAPI's and Classes are now available which can do away with the need for BDC's  in most cases.
    job done.
    cheers
    jimbo

  • COPA Report Layout with Object List (ALV)

    Hi,
    I have question about the COPA report layout with object list (ALV). Everytime I executed the report with ALV format, the amount for quantity column always shows with 3 decimal number, menwhile for amount column always follow by 2 decimal number.
    Can anyone help me regarding this matter? I do not know how to turn off the decimal number to be 0 in this type of layout, although in the form itself I already put 0 decimal number.
    Thanks.

    Hi,
    Better to raise this issue in CO Forum. You can expect some solution.
    regards

  • Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Select the text, and open the Appearance palette (Come on guys, text highlight is irrelevant, it happens to objects too says the OP), and see what's listed there.  For a simple text object, there should only be a line item "Type", followed by "Characters", and when double-clicked the Characters line item expands to tell you the stroke and fill color.  For a basic object, there should be a fill and/or stroke.
    What happens sometimes, is that you end up adding extra strokes/fills to objects or text, and the appearance palette is where that will be noted.  Especially when you are dealing with groups, and/or picking up a color with the eyedropper, you may inadvertently be adding a fill or stroke on top of something.  You can drag those unwanted thingies from the Appearance palette into its own little trash can.

  • Problem with object view with primary-key based object identifier

    Hello!
    I met such problem.
    t1 is persinstent-capable class:
    class t1 : public PObject { .... };
    T1OV is object view, based on object table T1OT
    I1 is primary key of the table T1OT.
    Next code:
    t1* t = new (conn, "T1OV") t1(...);
    conn->commit();
    try
    t->markDelete();
    conn->commit(); // exception throws here
    Works fine if T1OV defined as:
    create view t1ov of t1 with object identifier default
    as select * from t1ot;
    And throws an exception
    "ORA-22883: object deletion failed"
    if:
    create view t1ov of t1 with object identifier (I1)
    as select * from t1ot;
    Such problem also occurs when object view is based on relational table/view (OID is primary-key based).
    Also it occurs when
    t->markModified() used insted of t->markDelete()
    I am using Oracle 9i second release for windows and
    MS VC++
    Thank You

    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_85a.htm#2065512
    You can specify constraints on views and object views. You define the constraint at the view level using the out_of_line_constraint clause. You define the constraint as part of column or attribute specification using the inline_constraint clause after the appropriate alias.
    Oracle does not enforce view constraints. However, operations on views are subject to the integrity constraints defined on the underlying base tables. This means that you can enforce constraints on views through constraints on base tables.
    Restrictions on View Constraints
    View constraints are a subset of table constraints and are subject to the following restrictions:
    You can specify only unique, primary key, and foreign key constraints on views. However, you can define the view using the WITH CHECK OPTION clause, which is equivalent to specifying a check constraint for the view.
    Because view constraints are not enforced directly, you cannot specify INITIALLY DEFERRED or DEFERRABLE.
    View constraints are supported only in DISABLE NOVALIDATE mode. You must specify the keywords DISABLE NOVALIDATE when you declare the view constraint, and you cannot specify any other mode.
    You cannot specify the using_index_clause, the exceptions_clause clause, or the ON DELETE clause of the references_clause.
    You cannot define view constraints on attributes of an object column.
    Rgds.

  • Can I group charts with objects in Numbers 3.0?

    In Numbers 2.1 I could group charts with objects and text.  I can't get this to work in Numbers 3.0.  The objects will group but not the charts.
    I used this to create marked-up charts in Numbers and paste them into a Pages document.
    (I just purchased a new iMac and don't have the old Numbers on it.)

    The only way around this is to print to PDF and open in preview, then use the rectangular selection tool to select the are you want to add to pages, then copy, then paste into Pages.
    You can post feedback to Apple using the menu item "Numbers > Provide Numbers Feedback"
    There are several features that were dropped and may be added back in... see this link:
    http://support.apple.com/kb/HT6049?viewlocale=en_US&locale=en_US

  • Docs with  object status

    list of document with object status, can somebody explain how does it work and how to activate a status
    how can we activate new user status for documents, pl help
    Edited by: varada rajan on Apr 3, 2008 7:31 AM
    Edited by: varada rajan on Apr 3, 2008 7:46 AM

    Hi,
    If you are talking about sales order status, this can be configured through status profile.
    SPRO-SD-SALES-SALES DOCUMENTS - DEFINE & ASSIGN STATUS PROFILE.
    Based on the user status you have maintained for your sales document, the status can be viewed in table JEST.
    For this first go to VBAK - get document condition header, and take this document condition header and go to table JEST.
    Here your current status will start with E**** and status inactive flag would be blank.
    Hope this helps you.
    Reward points for contribution if it does.
    Regards
    Ravi

  • Mapping refcursors with object types in a procedure

    Hi all,
    I need some help regarding the mapping of refcursors with object types .
    Example: Procedure "A" has object types as input/output parameters which lies in the Web Method Application as a API.
    We are creating a procedure "B" which has ref cursors as input/ouput parameters
    which will map to the Procedure "A"'s object type parameters.
    It will be highly needful for the solution.
    Regards
    Saugata

    Your pseudocode has a lot of steps in it, but you didn't say which step you need help with. Since I already covered going from a nested table type to a refcursor, I'll assume you want an example that goes the other way now, like from a refcursor to a nested table type. Here's one ...
    SQL>
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create type nested_table_type as table of varchar2(14) ;
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL> create function func
      2    ( p_cursor in sys_refcursor )
      3    return nested_table_type
      4  as
      5    v_nested_table nested_table_type ;
      6  begin
      7
      8    fetch p_cursor bulk collect into v_nested_table ;
      9    return( v_nested_table );
    10
    11  end;
    12  /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL> select func( cursor( select dname from dept ) ) as nested_table from dual ;
    NESTED_TABLE
    NESTED_TABLE_TYPE('ACCOUNTING', 'RESEARCH', 'SALES', 'OPERATIONS')If your cursor selects objects instead of simple data types, the code is pretty much the same.
    SQL> create type object_type as object ( c1 varchar2(14), c2 varchar2(13) );
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL> create type nested_table_type as table of object_type ;
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL>
    SQL> create function func
      2    ( p_cursor in sys_refcursor )
      3    return nested_table_type
      4  as
      5    v_nested_table nested_table_type ;
      6  begin
      7
      8    fetch p_cursor bulk collect into v_nested_table ;
      9    return( v_nested_table );
    10
    11  end;
    12  /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL> select
      2    func( cursor( select object_type( dname, loc ) from dept ) ) as object_table
      3  from dual ;
    OBJECT_TABLE(C1, C2)
    NESTED_TABLE_TYPE
      ( OBJECT_TYPE('ACCOUNTING', 'NEW YORK'),
        OBJECT_TYPE('RESEARCH', 'DALLAS'),
        OBJECT_TYPE('SALES', 'CHICAGO'),
        OBJECT_TYPE('OPERATIONS', 'BOSTON')
      )(NB I manually reformated the query results for clarity).

  • Generate error list with object detail

    Dear All,
    I have two way (multimaster ) Replication but due to some reason it generated many errors during replicate data so to resolve errors, I want to generate error list (Report) with object details instead viewing them one by one. please guide
    Thanks

    What do you mean with generate error list (Report) with object details ?
    You can get all the errors from DEFERROR view.
    There are columns DEFERRED_TRAN_ID and CALLNO.
    You can join this columns with DEFCALL (DEFERRED_TRAN_ID and CALLNO).
    Joining this two views will provide information about the objects and transaction type involved in the call.
    DEFCALL.PACKAGENAME contains the reference to the table_name.
    DEFCALL.PROCNAME contains information about the transaction type.
    Example:
    select e.deferred_tran_id,
           e.callno,
           e.origin_tran_db,
           c.packagename,
           c.procname
    from deferror e, defcall c
    where e.deferred_tran_id=c.deferred_tran_id
    and e.callno=c.callno(below are the links to the 10gR2 docs containing information about DEFERROR and DEFCALL views. If your database is different version, than search http://tahiti.oracle.com for version specific documentation)
    DEFERROR
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14227/rardeftranviews.htm#sthref2599
    DEFCALL
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14227/rardeftranviews.htm#sthref2595
    Cheers!
    Message was edited by:
    tekicora

  • No authorization for action: CRE with object: ADCP

    Hi,
    I encountered the following error when creating an index:
    No authorization for action: CRE with object: ADCP
    I was at transaction DB02 -> 'Checks' -> Database<->ABAP/4 Dictionary.
    The checks indicate that there are some optional indexes that are not created.
    The error is encountered when I select one of these indexes (eg. ADCP-I01) and try to create it using the 'Create in DB' button.
    Do I have to assign some certain permission to my account? I am already holding the SAP_ALL and S_A.SYSTEM profiles.
    Thanks for any help,
    Tzyy Ming

    Hello,
    As i had expected DDIC userid did the needful.
    to see whether the index is created, you need to do the following.
    start transaction DB02
    click on the refresh button
    You would then get a new pop up with two different buttons.
    now on this pop up click the 'perform database checks' button.
    System might give you a warning 'This will take time' , click yes and wait for the system to refresh the data.
    Once system has refreshed the database data, you should be able to see your newly created index.
    Regards,
    Siddhesh

  • BOM UPload with object dependencies

    Hi PP Gurus,
              Does anyone have a LSMW project or upload program to upload BOM with Object Dependencies?.. I would really appreciate if someone could help me. Thank you very much.
    Sincerely,
    Heinrick Palad

    Hi Sir..
          Do you have an existing excel template for this BAPI. I cant seem to find the field where it assigns object dependencies.
    Thank you Sir

  • Creating a GUID with Objective-C (iPhone)

    Hi there,
    Can anybody point me to a code snippet which shows how to create a GUID with Objective-C? I cannot use the Device ID as I do need unique ids within the application itself (and the Device ID is always the same, obviously...).
    Thanks!

    Found the md5 method. Thanks anyway.

  • Why Bother with Objective C?

    Given the tools out there for writing iOS apps in HTML, Jquery, C#, Ruby, etc, including some with generate apps that can run on both Android and iOS,
    why bother writing in Objective C?
    What are the advantages?
    thx         

    red_menace wrote:
    RubyMotion is not a bridge or an interpreter or a wrapper, it is built directly on top of the Objective-C run time, so there isn't really a downside if Ruby is your thing.
    Interesting. Do you know of any similar projects with different languages? RubyMotion looks cool, but only if, as you say, "Ruby is your thing". For me, it is just another syntax. Objective-C is just C with a few "@" characters and a lot of "[]", so why bother? Now if there was a Perl front-end, that would be interesting.
    I found the following list of LLVM front-ends:
    Here is a tutorial on building your own: http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/
    LLVM Projects page has more information: http://llvm.org/ProjectsWithLLVM/
    Now, where am I going to find a BNF for Perl
    PS: Yes, I know about CamelBones. Unfortunately, both the project and its author are no more.
    But to get back to the question of why bother with Objective-C, the answer is clearly the Objective-C runtime. It doesn't turn C into Perl, but it comes quite close. It comes so close that it really isn't worth ones time to bother with Objective-Perl.

Maybe you are looking for

  • Collect Message without correlation

    Hi, I have a scenario. I have to collect 10 files which has like 100 bytes of information in each file and they should be collected into a single file every five minutes. I dont know whats inside the file. The data may vary...How  do I collect these

  • Can't view tickets in Help Desk

    What to do? Got error: 'View not found' This topic first appeared in the Spiceworks Community

  • My Ipod keeps freezing up

    My ipod was working just fine but my brother thought it would be fun top tap an electric fly swatter on it. I dont know if that would cause it to freeze up but that's my only thought. Could an electric shock causes that?

  • Suggestion on protecting tabs.

    == Issue == I have another kind of problem with Firefox == Description == Suggestion on eyelashes. It would be interesting if the tabs could be "protected", so if you accidentally click in the "x" to close tab, you ask a question of confirmation. ==

  • Query not opening!

    Hi, i have created a query by copying from other query and transported it.But i couldnt open the new query. I couldnt understand what the problem is. first query is working fine. Transportation is successful. pls, help me in this shylaja.