Once again RowFilter: tension between minimal api and usability?

Hi experts,

(Yes, I'm still struggling with RowFilters ;-)

The minimal api I am referring to is comparisonType.greater: she has values before, after, equal, is not based on equality. It is complete because as before equality comparisons can be expressed by a non - logic after.

An important aspect of usability (as I see it :) is consistency: learn a dialect of lifestyle, model,... and the reuse of the incomparable contexts.) This is the model to use a RowFilter on comparable
RowFilters.compareFilter(Before, comparisonValue, index);
Of course, this model cannot be used for comparisons as "composed" comparisons:
// ease-of-use-version, can't be done
RowFilters.compareFilter(Before-And-Equal, cv, i);

// instead have to break the habit
RowFilter after = RowFilters.someFilter(After, cv, i);
RowFilters.notFilter(after);
Hmm... now in a frame I could hide the effort two lines behind a factory method
RowFilters.beforeAndEqualFilter(cv, i);
Here the type of comparison is sucked out of the parameterlist in the name of the method. For a consistent api, this plant would have to have coverage methods beforeFilter, secondary filter... etc.

An alternative approach would be to have a new comparisonType.greater (unfortunately, it's an enum - not expandable) with all the combinations and re - implement comparing filters. BTW, it is necessary in any case, it should be applicable to all the comparables.

Hmm... (incoherent?) infancy, mainly because I really can't decide me ;-) Advice, please?

Thank you
Jeanette

PS: transferred to the forum of SwingX at java.net
http://forums.Java.NET/Jive/thread.jspa?threadID=153709

Methods how did you decide to compare? For simplicity I would go with redundancy leaving the developer to decide.

Filter compareToFilter(ComparisonTypeExt type, Comparable value, int.. columns);
 Filter compareToFilter(ComparisonTypeExt type, Comparator comparator, T value, int.. columns);
Filter betweenFilter(RangeType type, Comparable from, Comparable to, int.. columns);
 Filter betweenFilter(RangeType type, Comparator comparator, T from, T to, int.. columns);
Filter containsFilter(Collection values, int... columns);

// maybe better name :) Left out "than" so it's shorter.
public enum ComparisonTypeExt { LESS, LESS_OR_EQUAL, EQUAL, NOT_EQUAL, GREATER_OR_EQUAL, GREATER }
// FROM_INCLUSIVE same effect as TO_EXCLUSIVE, etc
public enum RangeType { ALL_INCLUSIVE, FROM_INCLUSIVE, TO_INCLUSIVE, ALL_EXCLUSIVE, FROM_EXCLUSIVE, TO_EXCLUSIVE }

I think that to choose a default value: all-inclusive seems more natural ("choose a number between 1 and 10"), but inclusive makes more sense for developers (for several beaches: age groups [0-15 > [15-25 > [25-50 > [50 >]]]]) and fits indexed table/list of Java.

Standard SQL BETWEEN is all included (at least SQL92 one I found first), but implementations may not be (http://www.w3schools.com/sql/sql_between.asp).

Tags: Java

Similar Questions

  • After you type the master password in session can force type master password once again without ending the current session and start new session?

    Sometimes after using the password to access an account during a given session of firefox, I want to "repeal" this ability of automatic access (i.e. require type the password again once) without having to put an end to the current session and restart firefox.

    It's nice to only have to type the password once per session, there are times when after launching an action that I would let the browser unattended for a short period but to prevent others to access sensitive information on other sites if they can't my master password. Note that this is not the same thing as "locking the browser. Currently, the only way I know to force it is to kill the session and restart the browser but it's not very satisfying if I really want to stay connected (allowed) to a particular site. I hope that adding a button in the Security tab "requires the master password for the current session" would be a simple solution to implement? Thank you for your attention.

    You can connect from the software security device (e.g. click Cancel in the dialog box display the passwords) to force them to return to the MP once more.

    • Tools > Options > Security: passwords: "saved passwords" > "show passwords".
    • Tools > Options > advanced > encryption: Certificates > safety devices: software security device: Logout button
  • Sharing of inconsistency between the API and the user interface for catalog

    In the vCloud Director UI, you can go to the properties of a catalog and share TWO everyone in read-only AND specific users/groups to have full control of the value. The API seems to allow to BE ReadOnly value all or specific users/groups to full control. Even when I put the two in the UI, when I do a GET with the API, if IsSharedToEveryone is set to true, the individual user/group access control settings are not displayed. They are mutually exclusive?

    So who is correct? the API or the UI?

    If the user interface is correct, how can I get the same result with the API?

    What I want to achieve, is to allow full control to a specific group of users and read-only for everyone.

    The workaround is to have a group set for total control and another with everyone in the org in a different group of read-only value.

    Hello

    This is a limitation of v1.0 of the vCD REST API. It is already fixed and will be available in the next version.

    In this case, the user interface is correct.

    Kind regards

    Todor Todorov

  • Perform calculations between the weeks and categories

    Given this example, if I calculate the difference between each week the intention and filing to show in the lines of the plan again and again filing?
    Row#     SEM     STUDENT_LEVEL     COLLEGE     PROGRAM     STATUS     Y3W2     Y3W3     Y3W4     Y3W5     Y3W6
    
    1     40     GR     BN     BMA-SJ     14.Intend     132     132     137     139     139
    2     40     GR     BN     BMA-SJ     17.Deposit     100     111     115     114     117
    3     40     GR     BN     BMA-SJ     20.New Intend     0     0     0     0     0
    4     40     GR     BN     BMA-SJ     21.New Deposit     0     0     0     0     0
    For example, the value displayed in Col: Y3W3 line #4 deposit must be the result of line Y3W3 2 - Row 2 Y3W2. Digitally: 111 minus 100 = 11.
    Tier 4 after that calculation should look like:
    4     40     GR     BN     BMA-SJ     21.New Deposit     1     11     4     0     3
    If the change is negative, then we would show 0.

    There are also some Calc percentage within the week and the categories and between weeks and years, but if understand us this, we can hope that use to others, so we won't post the part yet.

    Here's the query portion and sampling data. The sample data are summarized from the level of detail:
    WITH ADMLIST AS 
    (
    SELECT 1 AS WEEKNO, 2009 AS YEAR,          40 AS SEM, 
        'GR' AS STUDENT_LEVEL,  'BN' AS COLLEGE, 'BMA-SJ' AS PROGRAM, 
        '14.Intend' AS STATUS,  139  AS TOT
    FROM DUAL UNION ALL 
    SELECT 1 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '17.Deposit',    94 FROM DUAL UNION ALL 
    SELECT 1 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '20.New Intend',  0 FROM DUAL UNION ALL 
    SELECT 1 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '21.New Deposit', 0 FROM DUAL UNION ALL 
    SELECT 2 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '14.Intend',    132 FROM DUAL UNION ALL 
    SELECT 2 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '17.Deposit',   100 FROM DUAL UNION ALL 
    SELECT 2 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '20.New Intend',  0 FROM DUAL UNION ALL 
    SELECT 2 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '21.New Deposit', 0 FROM DUAL UNION ALL 
    SELECT 3 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '14.Intend',    132 FROM DUAL UNION ALL 
    SELECT 3 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '17.Deposit',   111 FROM DUAL UNION ALL 
    SELECT 3 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '20.New Intend',  0 FROM DUAL UNION ALL 
    SELECT 3 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '21.New Deposit', 0 FROM DUAL UNION ALL 
    SELECT 4 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '14.Intend',    137 FROM DUAL UNION ALL 
    SELECT 4 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '17.Deposit',   115 FROM DUAL UNION ALL 
    SELECT 4 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '20.New Intend',  0 FROM DUAL UNION ALL 
    SELECT 4 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '21.New Deposit', 0 FROM DUAL UNION ALL 
    SELECT 5 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '14.Intend',    139 FROM DUAL UNION ALL 
    SELECT 5 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '17.Deposit',   114 FROM DUAL UNION ALL 
    SELECT 5 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '20.New Intend',  0 FROM DUAL UNION ALL 
    SELECT 5 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '21.New Deposit', 0 FROM DUAL UNION ALL 
    SELECT 6 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '14.Intend',    139 FROM DUAL UNION ALL 
    SELECT 6 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '17.Deposit',   117 FROM DUAL UNION ALL 
    SELECT 6 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '20.New Intend',  0 FROM DUAL UNION ALL 
    SELECT 6 , 2009, 40, 'GR', 'BN', 'BMA-SJ', '21.New Deposit', 0 FROM DUAL 
    )
    SELECT sem,
           student_level,
           college,
           program,
           status,
    --       max(CASE WHEN WEEKNO=2 AND YEAR=2007 THEN TOT END) AS Y1W2,
    --       max(CASE WHEN WEEKNO=3 AND YEAR=2007 THEN TOT END) AS Y1W3,
    --       max(CASE WHEN WEEKNO=4 AND YEAR=2007 THEN TOT END) AS Y1W4,
    --       max(CASE WHEN WEEKNO=5 AND YEAR=2007 THEN TOT END) AS Y1W5,
    --       max(CASE WHEN WEEKNO=6 AND YEAR=2007 THEN TOT END) AS Y1W6,
    --       max(CASE WHEN WEEKNO=2 AND YEAR=2008 THEN TOT END) AS Y2W2,
    --       max(CASE WHEN WEEKNO=3 AND YEAR=2008 THEN TOT END) AS Y2W3,
    --       max(CASE WHEN WEEKNO=4 AND YEAR=2008 THEN TOT END) AS Y2W4,
    --       max(CASE WHEN WEEKNO=5 AND YEAR=2008 THEN TOT END) AS Y2W5,
    --       max(CASE WHEN WEEKNO=6 AND YEAR=2008 THEN TOT END) AS Y2W6,
           max(CASE WHEN WEEKNO=2 AND YEAR=2009 THEN TOT END) AS Y3W2,
           max(CASE WHEN WEEKNO=3 AND YEAR=2009 THEN TOT END) AS Y3W3,
           max(CASE WHEN WEEKNO=4 AND YEAR=2009 THEN TOT END) AS Y3W4,
           max(CASE WHEN WEEKNO=5 AND YEAR=2009 THEN TOT END) AS Y3W5,
           max(CASE WHEN WEEKNO=6 AND YEAR=2009 THEN TOT END) AS Y3W6
    FROM ADMLIST
    GROUP BY sem,
             student_level,
             college,
             program,
             status
    ORDER BY 5;

    Hello

    You can get the difference from one week to the next (or 0) using the analytical LAG function, like this:

    GREATEST ( tot - LAG (tot) OVER ( PARTITION BY  status  -- and maybe other columns, like sem, student_level, ..., too
                                           ORDER BY      year
                          ,          weekno
                        )
           , 0
           )     AS dif
    

    Corresponds to the data you posted really what is in your tables, or is it the result of an earlier stage?

    If it's really in your tables, and then instead of select of your tables, select in a UNION of
    (a) your table except the lines where status = '21.New' file
    (b) your table, once again, with status ='21.New deposit "and the numbers of dif (as shown above) in the column tot.

    If the data you posted is a partially digested form of your RAW files, then dif can probably be incorporated into the digestion process.

    In any case, calculate dif until you rotate the data.

  • Map ID between vCloud Director and vCenter Chargeback by API

    I currently have a configuration where vCenter Chargeback automatically imports the hierarchies of vCloud Director by a data collector. I find difficulty in mapping a vCloud Director ID entity in a vCenter Chargeback one.

    I'll give a practical example:

    I vCloud Director organization ORGNAME and VM VMNAME.

    I want to generate a chargeback for the entity VMNAME report. How do I tell me what ID of entity should I spend in the report query if the only information I have comes from the vCloud Director?

    Thank you in advance,

    Marco

    Hi Marco,.

    To get the Id of the virtual machine in the entity report request, you have the following option: -.

    • Go step by step to VM, in this approach, you have to call according to API
    1. Get all the hierarchies, GET hierarchies--> this response API, get the id of the hierarchy based on the hierarchy name (name of the hierarchy will be same as the name of the Organization to vCloud Director)
    2. Hierarchy of browse, GET /hierarchy/ {hierarchyId} / browse--> this the API response, you get the id of the entity of the root of the hierarchy
    3. Entity to browse, GET /entity/ /hierarchy/ {hierarchyId} {entityId} / browse--> this response from the API, you will GET the ID of the entity for immediate children of the entity of the root of the hierarchy
    4. Go by calling the entity API browse recursively until you reach your desired VM (or entity).

    Please note that travel entity API returns very few details about the entity (name and entity id). If you want to filter your VM (or other entity) based on the name, this might be enough for you.

    But if you want to filter your VM (or other entity) on other criteria, you may need to call ' entity Get GET /entity/ /hierarchy/ {hierarchyId} {entityId} "API for more details on the entity.

    If you to filter the VM (or other entity) based on the attribute custom, you can use the API ' get the attributes of an entity, GET /hierarchy/ {hierarchyId} /entity/ {entityId} / attribute.

    • If the size of your hierarchy is not great (you don't have too many entities in the hierarchy), you can follow the following approach: -.
    1. Get all the hierarchies, GET hierarchies--> this response API, get the id of the hierarchy based on the hierarchy name (name of the hierarchy will be same as the name of the Organization to vCloud Director)
    2. Get hierarchy, GET /hierarchy/ {hierarchyId}--> this response API returns you all entities in the hierarchy with a single blow. Once again very little detail of the entity is returned (name and entity id), if you want to refine your entity on other criteria rather than by name, then you need to use 'Get entity' or 'Get the attributes of the entity year' as explained above.

    Please note that if Director vCloud in vCenter Chargeback hierarchies that are filled automatically, there is a named "vCloudEntityId" located on the rebilling of entities corresponding to entities vCloud Director of custom attributes. The value of the custom attribute "vCloudEntityId" represents the entity type id and the vCloud vCloud Director entity.

    For example, if a TIME named "helloVapp" has id 123456 into vCloud Director. Then in vCenter chargeback the value of the custom attribute "vCloudEntityId" will be "VcloudVappEntity-123456"for this "helloVapp" TIME."

    I hope this helps.

    -Amrainder

  • After installing ElCapitan 10.11.4 on my G5, if I stopped for the night for some reason, the computer starts again sometime between 03:00 and 07:00. Any thoughts?

    After installing ElCapitan 10.11.4 on my G5, if I stopped for the night for some reason, the computer starts again sometime between 03:00 and 07:00. Any thoughts?

    Sounds like an Energy Saver preference, but what computer do you use?  A G5 (PowerPC) machine will not work on El Capitan.

  • I closed my laptop (Macbook pro 2012) screen with a day and immediately after 30-40 minutes his does not starts once again.

    I closed my laptop (Macbook pro 2012) screen with a day and immediately after 30-40 minutes his does not starts once again.

    Hello Varshil07,

    Thank you for using communities of Apple Support.

    If I understand your message, by updating your Mac you have forced stop, or you have closed the lid, and now it does not start.  To start, I suggest that try you to start in safe mode by following the instructions below.  For later use, it's a good idea to not force the computer to shut down or close the lid while it is up to date, because it can cause problems.

    1. Choose the Apple menu > shut down.

    2. After your Mac stops, wait 10 seconds, then press the power button.

    3. As soon as you hear the startup tone, hold down the SHIFT key.

      You must press the SHIFT key as soon as possible once you hear the startup tone, but not before.

    4. Release the SHIFT key when you see the gray Apple logo and progress indicator.

    To exit safe mode, restart your Mac, but no press during the startup.

    OS X El Capitan: start in safe mode

    Have a good.

  • I have a 6 and when I said an iMessage that he will tell me when the person read it then it will say delivered once again so I don't know when it was read

    I have a 6 more and when I send an iMessage he tells me when the person read it then it will say delivered once again so I don't know when it was read

    I have exactly the same problem since I updated to 9.3, the 9.3.1 update didn't fix either. Apple support think it could be a software problem or operations and I have tried literally everything! Have you found a solution for this yet?

  • When I change bookmarks and close firefox and open upward once again changes to my favorites are returned to what they were before, I changed them?

    When I change my favorites and the close firefox and the open upward once again changes to my favorites are returned to what they were before, I changed them?

    Try the solutions in Impossible to add, edit, or save bookmarks - how to fix

  • Mail is stuck in a loop, force quit/restart it closes, and then when I opened the Mail once again, the cycle starts over.

    I am El Capitan OS X 10.11.3, Mail is stuck in a loop, I was responding to a message, and I tried to send it. Now, he presents this message, and then switch to another message / desktop /, mail inbox home screen, then the loops again.   Force quit and restart it closes, then when I open the Mail once again, the cycle starts over.

    I can't use the mail app at all.

    Open the menu go with down option - Open Library - containers and move the folder "com.apple.mail" on the desktop.

    Restart your Mac and check if it works very well.

  • I click analyize it is said you should defragment this volume then I run imediatlly once again and he said that I should defragment. Once again

    Original title: Disk Defragmenter

    I click analyize it is said you should defragment this volume then I run imediatlly once again and he said that I should defragment. again, I have windows Xp IE8 and Ms s essentials do it please answer very clear, I'm not very good with computers, I'm an old guy, thank you.

    Hi RichSQL,

    Follow these methods.

    Method 1: Follow these steps:

    Step 1: Relocation of defragmentation

    (a) in the disk, find the directory c:\Windows\Inf. If the system directory is not on the c: drive or not named Windows, find by clicking on "Start", then "run" and type %Windir%\Inf in the area.

    (b) find the file called dfrg.inf.

    (c) right click on the file and select "install".

    Step 2: Repair defrag

    un) Click on "Start", then "run", run this command: regsvr32 dfrgsnap.dll.

    (b) click "Start", then "run" and execute this command: regsvr32 dfrgui.dll.

    (c) run Defrag.

    Method 2: Follow the steps in the article.

    Disk Defragmenter does not work on a Windows XP-based computer

    http://support.Microsoft.com/kb/922379

  • Why my Windows XP Home Edition starts to go in safe mode and restart once again?

    Whai my startup Windows XP family, go to safe mode and restart once again cannot installation

    You can configure your computer Windows XP does not start on startup, so you can see the error code when it is blue screening.

    Disabling the option of automatic reboot in Windows XP, go to control panel in Windows XP in a left click on start, followed by settings and then choose Control Panel.

    1. In the Control Panel window, open System.

      In the System Properties window, click the Advanced tab.

    2. Locate the Startup and recovery area, and click on the settings button.

    3. In the Startup and recovery window, find and uncheck the checkbox next to automatically restart.

    4. Click OK in the Startup and recovery window.

    5. Click OK in the System Properties window.

    6. Now when a problem causes a BSOD or other errors that crash the system, your computer will automatically restart. You will need to perform a manual restart.

    Let us know if that helps.

  • Anyone know if where I can download the keyboard screen on again once... my normal keyboard broke, and some how I enlarged it on screen one and cant end settings or information to do little new... its takng upward all over my screen :(

    Anyone know if where I can download the keyboard screen on again once... my normal keyboard broke, and some how I enlarged it on screen one and cant end settings or information to do little new... its takng upward all over my screen :(

    Try this:

    Ctrl + alt + delete > bottom left on the Page, click, accessibility > uncheck, magnifying glass, keyboard

    HTH

    If I brought you joy, vote! If I answered your question, click, propose as answer! > WT

  • Windows has been removed and once again, the Epson Stylus CX4800 printer acceptable printers.

    Download driver printer Epson Stylus CX4800, etc., last nite... today do not have access to the printer... Windows has been removed and once again, the Epson Stylus CX4800 printer acceptable printers.  What can I do to get this printer permanently replaced on the acceptable list of printers or if I should buy a new printer!  This has been a problem for almost 2 weeks now... What can I do? Every time that you add the printer to the list as soon as I turn off the PC, the printer is removed from the list of Windows! Is this a defect of the windows program I or is this printer is no longer one that windows will recognize?

    Help!

    Hello

    "Every time that you add to the list"

    We do not do anything.

    It is not Microsoft.

    These are public Forums set up by Microsoft on their servers and animated by them.

    We are mainly Windows users help each other here.

    Here is the link to Epson to the latest drivers for your printer model.

    Choose the appropriate operating system from the Menu drop-down.

    http://www.Epson.com/cgi-bin/store/support/supDetail.jsp?OID=58606&BV_UseBVCookie=Yes&infoType=downloads&platform=OSF_W_VISTA-32

    And a Troubleshooting Guide for it.

    http://www.Epson.com/cgi-bin/store/support/supDetail.jsp?BV_UseBVCookie=Yes&infoType=overview&OID=58606

    See you soon.

  • My mce has been in windowed mode with a 16:9 aspect ratio and I watched a video well 4:3, I've narrowed the window for a while, then when I opened the window once again the window was a 4:3 aspect with the 4:3 video

    It retains this operation and I tried to reconfigure my monitor, but that does not help him I had this problem so that my operating system vista 64 died and had to bereloaded and then it was new right, but now he's screwing, once again, is very frustrating as my mce used fing my hd channels (my tuner is a tuner Digital hd hauppauge2250)

    Hello DanC08,

    Your issue is with Windows Media Center, I suggest that ask you your question at thegreenbutton.com/forums.
    It is a Microsoft site and deals only with problems of Windows Media Center.

    Click here for a link to the message.

    Sincerely, Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

Maybe you are looking for

  • Satellite A100 - 065 (PSAANA) - can I spend it with a SATA2 HARD drive?

    Hello Forum! I want to upgrade to a hard disk of 120 GB (Hitachi) to a 500 GB (Western Digital). I don't know if this A100 supports SATA2. I think it's to do with the hard disk controllers that are on the motherboard. This is information I don't thin

  • Satellite A200 AH3 stops instead of standby when I close the lid

    Hello I have a laptop Satellite A200 AH3. When I bought Windows Vista was preinstalled (I still drive recovery). When I closed the lid of the previous day (I mean the monitor turn off the HD, the cooling fan and all the rest). The light On / Off on t

  • Amount of print Page

    Hello! How many pages can be printing ink for HP Laserjet 1020? Thank you

  • HP ENVY X 2 PC: games 3d green image graphic

    Hello I just bought hp envy 2 11 pc, product number x: C0U47EA #ABU. and I installed a few games. However, I found problems in games graphics asphlat 3d 8. It shows a green image below. I downloaded and updated graphics drivers (sp63677) and bios (sp

  • Connection to printer program

    Hello both of my printers will not communicate with my computer.  One is wired and we're wireless.  They were both very well a few days ago.  Now, they will not print or scan.  The cable it is said that the installation of the device is not over.  A