Using sequences.sort?

I have my own javaFx class GridRow.
I want to sort an array of instances of GridRow.
For this I was using Sequence.sort() method given in API
public sort(seq: java.lang.Object[], c: java.util.Comparator)
I mention my array in the Object[] but for the comparator I am unable to figure out what to do.
If I create a class implementing comparator in java then while defining the compare(Object o1,Object o2) method I am unable to type cast o1 and o2 into my Fx node's instances as I could not find any way of accessing Fx classes inside java code.
If I create a class extending comparator in Fx then while defining the compare(Object o1,Object o2) method I am again unable to type cast o1 and o2 into my Fx node's instances.
I tried both ways I could think of:
This is pretty unexpected. Please help.

Try this:
import java.util.Comparator;
import javafx.util.Sequences;
var seq = ["AA", "A", "AAAA", "AAA"];
var sortSeq = Sequences.sort(seq, Comparator{
        public override function compare(obj1:Object, obj2: Object):Integer{
            obj1.toString().length() - obj2.toString().length();
println(sortSeq);

Similar Messages

  • Can I transfer my hand made album sequence (sort order) defined in element when I turn a local album into a mobile album used with IPAD. Or do I have to change the dates artificially?

    Can I transfer my hand made album sequence (sort order) defined in elemenst when I turn a local album into a mobile album used with IPAD. Or do I have to change the dates artificially?

    Andrew, I know I am extremely late to the party but I too use Grid View.  I had the same problem that you had but have found this to work for me.  I used it and it is still holding as my default sorting even after switching between the Artist page and Grid View.
    Once you are inside of the Artist page continue to click on the Album column until it shows Album by Artist/Year.
    That will give you each album sorted by the year instead of it randomly sorting it for you each time you leave an Artist's page and then back again.
    Hope this helps.

  • How to use the SORT in the Fox Formulas

    Hi,
    Is it possible to use the  SORT in the Fox forumals, if it is so
    what is the syntax for SORT. 
    I
    Thanks in advance
    Best regards
    SG

    Hi,
    What exactly you want to SORT ?
    SAP provides in built sort functionality when you are using Looping conditions:
    For instance: Here in below example, data records will be come in sorted order of A,B,C. If you want to change the order, change the sequence.. B,A,C or as per your requirement.
    Foreach A, B,C
    Endfor.
    Thanks
    pratyush

  • How to use Sequence in Forms

    Hi,
    I have an Empno Column, At the time of Opening a Form The Empno Will be displayed by using Sequence.
    If the User doesn't save the Form Then the Empno Generated number will be changed.
    How to write the code to get sequence numbers at Empno columns by using Sequence?
    Thanks & Regards,
    Hari Babu

    Ok, I understand now your question. Since the oracle sequence is commited in a separate transaction, it is not possible to get the no-gap sequence, considering your example. In the other hand, if you don't commit immediately, than two concurrently opened forms could use the same sequence number, so you'll get the duplicate key!
    If you're sure that this couldn't happen, you can manage your own sequencing, storing them in another table. Let's say you reached seq 999: entering the form, you'll read from your sequence table 1000, increment to 1001, and assign it to empno, but without commiting. Next time, you'll get the same number, until you commit form, and at the same time, change in seq table. So another will get 1001.
    Downside of this approach are, as mentioned before, concurrent sessions, which will get the same sequence.

  • Comenting code - style - how to keep coments where you want them - without using sequences

    Silly question maybe about style of commenting.
    Basically i like to use sequence boxes to keep comments on my diagram beside the bits of code that they refere to - otherwise when you use diagram cleanup (which i'm afraid i use all the time) they go anywhere.  This is good - except that i found especially when doing FPGA programming the sequence boxes reduce the amount of parralelism that can go on - since the 'box' needs to finish before any of the outputs can be used.  Is there some other method i should be using instead of sequence boxes to keep text beside elements - without enforcing that a set of elements are fixed in one place?
    Solved!
    Go to Solution.

    I usually use labels of structures (loops, cases, etc) and labels of diagram constants, etc. for comments. In newer versions, we also have wire labels.
    (see also)
    What is your LabVIEW version? Also the LabVIEW 2011 cleanup does a better job keeping diagram comments together with the related code compared to earlier version.
    LabVIEW Champion . Do more with less code and in less time .

  • Oracle 11g - Memory used for sorting

    Hi everyone,
    I would like to know how I could analyze memory used for sorting in Oracle 11g. When I run the below query, it returns 1531381.
    select value from v$sysstat where name like 'sorts (memory)';But when I check sort_area_size parameter from v$parameter, it returns 65536. Does it mean my database is using more memory for sorting than sort_area_size. Or is the way I interpret v$sysstat view and sort_area_size wrong? What is the best way to monitor the memory usage for sorting? Thanks in advance.
    Regards,
    K.H
    Edited by: K Hein on Apr 5, 2012 8:16 PM

    check the valuse of pga_aggregate_target
    http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams157.htm
    Note:
    Oracle does not recommend using the SORT_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. SORT_AREA_SIZE is retained for backward compatibility.
    What is the best way to monitor the memory usage for sorting? try v$sort_usage
    or v$tempseg_usage
    col sid_serial for a44
    col size for a22
    col SID_SERIAL for a22
    SELECT b.tablespace,
            ROUND(((b.blocks*p.value)/1024/1024),2)||' MB' "SIZE",
            a.sid||','||a.serial# SID_SERIAL,
            a.username,a.osuser,
            a.program
       FROM sys.v_$session a,
            sys.v_$sort_usage b,
            sys.v_$parameter p
      WHERE p.name  = 'db_block_size'
        AND a.saddr = b.session_addr
    ORDER BY b.blocks;

  • I can't use the (sort by )feature, or open the emages to watch this item - I used to be able to do this with firefox and all of the sudden it stopped working

    I tried to log in :
    http://uae.dubizzle.com/motors/used-cars/land-rover/range-rover-sport/?price__gte=&price__lte=&year__gte=2006&year__lte=2009&kilometers__gte=&kilometers__lte=&seller_type=&keywords=&is_basic_search_widget=0&is_search=1&added__gte=&company_item_id=&auto_agent=
    I can't use the
    - (sort by )feature Lowest to highest for example ,
    - or open the emages to watch this item
    I used to be able to do this with firefox the old version and now all of the sudden it stopped working,
    I tried to clear cash & coockies & un install and reinstall fire fox but nothing works.

    You can try these steps in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Error Using Sequence in Weblogic

    I tried to use Sequence object in weblogic to generate auto-imcremental integers
    for my db insert keys. I first create a mydbsequece in oracle database. Then,
    I built a class in which I obtain a dataSource using jndi to look for my dataSource.
    And then use the ds to getConnection. After I had the connection, I do the following:
    Sequence sequence = new Sequence(con, "mydbsequence");
    int i = sequence.nextValue();
    When I call sequence.nextValue() method, I got the following error message: NullPointerException
    at Weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:65).
    Does anyone know what causes this error? and How do I fix it? Please advise me
    on this. Thank you very much.
    Qin

    Qin Ding wrote:
    >
    I tried to use Sequence object in weblogic to generate auto-imcremental integers
    for my db insert keys. I first create a mydbsequece in oracle database. Then,
    I built a class in which I obtain a dataSource using jndi to look for my dataSource.
    And then use the ds to getConnection. After I had the connection, I do the following:
    Sequence sequence = new Sequence(con, "mydbsequence");
    int i = sequence.nextValue();
    When I call sequence.nextValue() method, I got the following error message: NullPointerException
    at Weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:65).
    Does anyone know what causes this error? and How do I fix it? Please advise me
    on this. Thank you very much.
    QinSequence is a non-standard JDBC object. It is an Oracle-specific class, which presumably
    takes a standard java.sql.Connection in it's constructor. Oracle has repeatedly created
    such new classes with methods claiming to take java.sql.* arguments, but in fact they
    require an Oracle-specific class. In this case, however, we might succeed anyway if
    we dig some. Can you show me the entire stacktrace of the exception?
    Please take the attached jar file, and put it in front of all the weblogic stuff
    in the server's classpath, and repeat the problem and show me the new exception.
    From the line, I am assuming you're on the 6.1 version of WebLogic. If not, forget the
    jar, and let me know.
    Joe
    [61rmicon.jar]

  • Using sequence  in view

    hi gurus
    SQL> create view v1 as select s1.nextval from dual;
    create view v1 as select s1.nextval from dual
    *+
    ERROR at line 1:
    ORA-02287: sequence number not allowed here
    Are there only workaround?
    Thank you!

    There are some restrictions on using sequences you will want to know about
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/views.htm#sthref3092

  • USING SEQUENCE IN PACKAGE SPEC

    I Want to Use Sequence.NEXTVAL & Sequence.CURRVAL throughout the package. How can i declare the global sequence variable and make them available for all the stored procedures inside the package ?
    Any help highly appreciated..
    Thank you all in advance

    Data Boy wrote:
    No i know that but using directly SEQUENCE.CURRVAL inside the Insert statement is not a good practice.
    We need to declare inside the procedure a variable and then fetch the SEQUENCE.CURRVAL into that variable
    and use that variable inside the insert statement. But we that variable scope will be available only inside that procedure.
    if i want the same CURRVAL in another stored procedure. How can i get it ..that is my Question.What exactly are you trying to achieve?
    If it's a case of needing to know the value of the sequence number assigned to an inserted record you would typically use the RETURNING clause on the insert statement...
    SQL> create table temp (id number, val varchar2(20));
    Table created.
    SQL> create sequence temp_seq;
    Sequence created.
    SQL> ed
    Wrote file afiedt.buf
      1  create trigger trg_temp before insert on temp
      2  for each row
      3  begin
      4    select temp_seq.nextval into :new.id from dual;
      5* end;
    SQL> /
    Trigger created.
    SQL> set serverout on
    SQL> declare
      2    v_num number;
      3  begin
      4    insert into temp (val) values ('Fred') returning id into v_num;
      5    dbms_output.put_line('ID inserted was: '||to_char(v_num));
      6  end;
      7  /
    ID inserted was: 1
    PL/SQL procedure successfully completed.
    SQL> select * from temp;
            ID VAL
             1 Fred
    SQL>

  • Using Sequence in ODI

    Hi I am very new to this tool can anyone tell me how to use sequence and populate Primary key in my Oracle target table. I am doing File to Oracle Mapping.
    I am using ODI sequence but i am getting errors like:
    933 : 42000 : java.sql.SQLException: ORA-00933: SQL command not properly ended
    and also delete previous check sum in Session Control
    Need ur reply asap

    Thnx Madha!
    I have change my KM to IKM SQL Control Append but the problem still persists.
    I am getting the same error message in the control workflow (~Operator Window).
    1] Control-<TGT_SECURITYSEGMENT_DIMENSION>-Create Check Table and also
    2] Control-< TGT_SECURITYSEGMENT_DIMENSION>-delete previous check sum
    The Description of the same is:
    create table Exception getObjectNameDefaultPSchema("L", "SNP_CHECK_TAB", "W") :
    CATALOG_NAME VARCHAR2(100 CHAR) NULL ,
    SCHEMA_NAME VARCHAR2(100 CHAR) NULL ,
    RESOURCE_NAME VARCHAR2(100 CHAR) NULL,
    FULL_RES_NAME VARCHAR2(100 CHAR) NULL,
    ERR_TYPE VARCHAR2(1 CHAR) NULL,
    ERR_MESS VARCHAR2(250 CHAR) NULL ,
    CHECK_DATE DATE NULL,
    ORIGIN VARCHAR2(100 CHAR) NULL,
    CONS_NAME VARCHAR2(35 CHAR) NULL,
    CONS_TYPE VARCHAR2(2 CHAR) NULL,
    ERR_COUNT NUMBER(10) NULL
    and error is :
    922 : 42000 : java.sql.SQLException: ORA-00922: missing or invalid option
    [Note: The above create table script is generated by CKM Oracle Knowledge Module].
    I am using CKM Oracle KM for the Primary key constraint in My target Oracle Table. I think the Problem is somewhere else.
    Please Help.

  • Using sequence in sqlldr

    hi
    can we use already existing db sequence in sqlldr control file
    regards
    kedar
    attached is control file but i want to use nextkey_seq to populate client_id
    LOAD DATA
    INFILE 'COMM.csv'
    APPEND
    INTO TABLE COMMUNITY_REGISTER
    FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (CLIENT_ID,
    SURNAME,
    DATE_OF_BIRTH DATE "YYYYMMDD" ,
    SEX,
    DATE_LAST_UPDATED DATE "YYYYMMDD" ,
    CURRENT_STATUS,
    DATE_OF_CURRENT_STATUS DATE "YYYYMMDD" ,
    INITIAL_STATUS,
    DATE_OF_INITIAL_STATUS DATE "YYYYMMDD" ,
    GP,
    GPTYPE,
    LEAD_HCP,
    STAFF_TYPE,
    NHS_NUMBER,
    COMMUNITY_ID,
    MOTHERS_ID,
    PREVIOUS_SURNAME,
    FORENAME,
    TITLE,
    ALIAS,
    STREET_NO,
    STREET,
    LOCALITY,
    TOWN,
    COUNTY,
    POSTCODE,
    HEALTH_AUTHORITY,
    PHONE_NUMBER,
    INITIAL_SECTOR,
    CURRENT_SECTOR,
    REG_DISTRICT,
    OPCS_BIRTH,
    OPCS_RESIDENCE,
    ETHNIC_ORIGIN,
    CHANGED_BY_ID,
    CHILD_HEALTH_EXISTS,
    DIAGNOSES_EXISTS,
    TEXT_EXISTS,
    SPECIAL_NEEDS_EXISTS,
    ADMISSION_EXISTS,
    CHILD_PROTECTION_EXISTS,
    NEXT_OF_KIN_ID,
    NOK_RELATIONSHIP,
    NHS_TRACE_RESULT,
    PAS_NUMBER,
    REGISTRATION_ORIGIN,
    NBH_STATUS,
    SECTOR,
    MOBILE_NO,
    AUDIT_TIMESTAMP DATE "YYYYMMDD" ,
    AUDIT_ID,
    AUDIT_ORIGIN,
    TRANSFER_CHECKED,
    LAST_ACTION,
    RECORD_STATUS,
    TRACE_RESULT_DATE DATE "YYYYMMDD"
    )

    Kedar,
    You sure can use sequence nextkey_seq.nextval in your control file (don't remember the exact syntax, but you can find it in Utilities manual for SQL*Loader

  • How to use sequence in MS sql server?

    In Oracle DB we use sequence like that:
    SequenceImpl s = new SequenceImpl("customer_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setId(new Number(next.intValue()));
    But there is no sequence in sql server ,how can I do?
    Thank you~~

    MS SQLServer have a IDENTITY column property and UNIQUEIDENTIFIER data type that is somewhat similar to Oracle's sequence. I don't know whether your table contain either of these, or you just want to set sequential number to a column.
    Below is some info about IDENTITY and UNIQUEIDENTIFIER you may already know since they are in SQLServer Book.
    IDENTITY property: You can define IDENTITY property on a numeric column. You can set the seed and increment on this column property very much like Oracle's sequence. The only thing I think it does not have is the "nextval". You can use IDENT_CURRENT function or @@IDENTITY after an INSERT or SELECT INTO to get the last value generated. Of course you can use this value and add the increment to get the next
    value but it not the same as seqname.nextval which keep incrementing each time you call it. Getting the current identity value and adding the increment your self will not work for multiple sessions with pending
    insert. Another thing about column with IDENTITY property is that you cannot insert value into this column (i.e, omit it in your insert statement values) unless IDENTITY_INSERT is on, but only one table in a
    session can have IDENTITY_INSERT to be turned on.
    If you don't need to know the next seq value, then IDENTITY work similar to Oracle sequence. Execute select after postchanges or commit will have system generated values. If you need to get next value before insert, Sung suggest using SEQ_TABLE and managing the next value (write a database function to mimic Oracle'
    s nextval).
    UNIQUEIDENTIFIER datatype: UNIQUEIDENTIFIER is a 16-byte hexadecimal number indicating a globally unique identifier (GUID). The GUID is useful when a row must be unique among many other rows. You could use NEWID() to create a value of type uniqueidentifier or calling some API function that returns a GUID. The advantage of using uniqueidentifier is that the values generated by NEWID function or application GUID are guaranteed to be unique throughout the world. The disadvantage of using uniqueidetifier is that it is long and obscure, random, difficult for user to remember or type correctly. It is 16 byte, which is large compare to other datatype such as 4-byte integer.
    Thanks,
    Yvonne

  • How to Use Sequence in Oracle Views

    Hi ,
    I have created a view which gives the information about the access rights which a Resource has got. for ex -
    Res1 - GYM access - member
    Res1 - Swimingpool Access - member
    I need to identify a Primary Key for this data set. So i thought that i'll use a Sequence to generate an extra column in this view.
    But when i'm using the Sequence i'm getting the following error - "ORA-02287".

    you can use sequence within view it doesnot returned error;
    create sequence t1_seq MAXVALUE 150
    START WITH 39 INCREMENT BY 1;
    SQL> insert into t1_view values(t1_seq.nextval,'dd');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
    ID NA
    10 aa
    20 bb
    30 cc
    40 dd
    4 rows selected.
    SQL> insert into t1_view values(t1_seq.nextval,'ee');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
    ID NA
    10 aa
    20 bb
    30 cc
    40 dd
    41 ee
    5 rows selected.

  • Use of Sort Field in equipment Master

    Dear All
    What is the use of SORT field in Equipment Master Record

    Dear Kumar Sahoo,
    This field is for identification purpose and generally give similar technical objects
    example:if you have so motors like lathe and drilling and lifting and milling etc thease all motors are same motors and if you want see the list you can give sor name then see, otherwise you have to give each number and find out
    some  more benefit is you can list sorting and unic identification of similar objects
    generally using internal purpose, i mean there is no relation of external procurement or warranty or any outside of company activiteis.
    Hope this may helps you
    Prem

Maybe you are looking for

  • Error while transporting the cube

    Hi all, While I was transporting my cube from Development box to Acceptance box, following error occured.    Execution of programs after import (XPRA)    Transport request   : GCDK905220    System              : NCA    tp path             : /usr/sap/

  • Firefox 5 doesn't print properly

    When I used Firefox 3.5, it printed properly. I upgraded to Firefox 4, and printing had extra spaces between each letter, making the printout unreadable. Today I upgraded to Firefox 5, and found the problem has yet to be fixed. I am using Windows XP

  • In a purchase order for 3 GR's Quantity does not equal the value

    Hi, I have found the difference in one purchase order, there have been 3 GRs where the Qty does not equal the Value.  How has this happened? Any guesses why the difference has come. Thanks&regards, Veena

  • LR4 won't install.  Error message

    I just bought LR4 and it won't install.  Error message reads: Operation could not be completed. (com.apple.installer.pagecontroller error-1.) Couldn't open "Adobe Photoshop Lightroom 4.pkg". My operating system is: Mac OS X Version 10.5.8 Please advi

  • Don't know how to start db on linux

    Hi, I need some tips on how to config tnsnames.ora, listener file. Don't know what the command to run Oracle Net Assistant to config the above files. Please help. Are there any web site teach how to start up & shutdown db on linux. I have installed o