Examples of SortKey


Examples of com.foundationdb.qp.storeadapter.indexcursor.MergeJoinSorter.SortKey

        @Override
        public SortKey next() {
            if(next == null) {
                throw new IllegalStateException("No next");
            }
            SortKey t = next;
            try {
                next = reader.readNext();
                if(next == null) {
                    reader.close();
                }
View Full Code Here

Examples of javax.naming.ldap.SortKey

  public void testCompareTo002() {
   
    try {
      LdapName ln = new LdapName("t=test,cn=common");
      int i;
      i = ln.compareTo(new SortKey(""));
      fail("The string is null.");
    } catch (ClassCastException e) {
     
    } catch (Throwable e) {
      fail("Failed with: "+e);
View Full Code Here

Examples of javax.naming.ldap.SortKey

import junit.framework.TestCase;

public class SortKeyTest extends TestCase {

    public void testAll() {
        new SortKey(null);
        new SortKey(null, true, null);

        SortKey sk = new SortKey("attributeId");
        assertEquals("attributeId", sk.getAttributeID());
        assertTrue(sk.isAscending());
        assertNull(sk.getMatchingRuleID());

        sk = new SortKey("attributeId", false, "matchingRuleId");
        assertEquals("attributeId", sk.getAttributeID());
        assertFalse(sk.isAscending());
        assertEquals("matchingRuleId", sk.getMatchingRuleID());
       
       
        sk = new SortKey("attributeId", true, null);
        assertEquals("attributeId", sk.getAttributeID());
        assertTrue(sk.isAscending());
        assertNull(sk.getMatchingRuleID());
    }
View Full Code Here

Examples of javax.naming.ldap.SortKey

  public void testCompareTo002() {
   
    try {
      LdapName ln = new LdapName("t=test,cn=common");
      int i;
      i = ln.compareTo(new SortKey(""));
      fail("The string is null.");
    } catch (ClassCastException e) {
     
    } catch (Throwable e) {
      fail("Failed with: "+e);
View Full Code Here

Examples of javax.naming.ldap.SortKey

     * <p>
     * The expecting result is the control's ASN.1 BER encoded value.
     * </p>
     */
    public void testEncodedValueOfSortControl001() throws Exception {
        SortKey[] sk = { new SortKey("pepe", false, "leo") };

        SortControl sc = new SortControl(sk, true);
        assertEquals("30 10 30 0e 04 04 70 65 70 65 80 03 6c 65 6f 81 01 ff",
                toHexString(sc.getEncodedValue()));
    }
View Full Code Here

Examples of javax.naming.ldap.SortKey

        String[] sk2 = {"pepe", "", "haha" };
        sc = new SortControl(sk2, true);
        assertEquals("30 14 30 06 04 04 70 65 70 65 30 02 04 00 30 06 04 04 68 61 68 61",
                toHexString(sc.getEncodedValue()));
       
        SortKey[] sk3 = {new SortKey("pepe", false, "haha"), null, new SortKey("", true, "haha2"), new SortKey("haah", true, "pepe")};
        try{
            sc = new SortControl(sk3, true);
            fail("should throw NPE");
        }catch(NullPointerException e){
        }
       
        SortKey[] sk4 = {new SortKey("pepe", false, "haha"), new SortKey("", true, "haha2"), new SortKey("haah", true, "pepe")};
        sc = new SortControl(sk4, true);
        assertEquals("30 2a 30 0f 04 04 70 65 70 65 80 04 68 61 68 61 81 01 ff 30 09 04 00 80 05 68 61 68 61 32 30 0c 04 04 68 61 61 68 80 04 70 65 70 65",
                toHexString(sc.getEncodedValue()));

    }
View Full Code Here

Examples of javax.naming.ldap.SortKey

     * <p>
     * The expecting result is the control's ASN.1 BER encoded value.
     * </p>
     */
    public void testEncodedValueOfSortControl003() throws Exception {
        SortKey[] sk = { new SortKey("", true, "") };

        SortControl sc = new SortControl(sk, true);
        assertEquals("30 06 30 04 04 00 80 00", toHexString(sc
                .getEncodedValue()));

        SortKey[] sk1 = { new SortKey("pepe", true, "laura") };

        sc = new SortControl(sk1, true);
        assertEquals("30 0f 30 0d 04 04 70 65 70 65 80 05 6c 61 75 72 61",
                toHexString(sc.getEncodedValue()));
    }
View Full Code Here

Examples of javax.naming.ldap.SortKey

    }
    if (sorted)
    {
      SortKey[] keys = new SortKey[SORT_ATTRIBUTES.length];
      for (int i=0; i<keys.length; i++) {
        keys[i] = new SortKey(SORT_ATTRIBUTES[i]);
      }
      try
      {
        ctls[0] = new SortControl(keys, false);
      }
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

                    @Override
                    public void run() {
                        // Sort the line column if it is the primary sort key in ascending order.
                        List<? extends SortKey> sortKeys = table.getRowSorter().getSortKeys();
                        if(sortKeys.size() >= 1) {
                            SortKey sortKey = sortKeys.get(0);
                            if(sortKey.getColumn() == COLUMN_LINE && sortKey.getSortOrder() == SortOrder.ASCENDING) {
                                table.scrollRectToVisible(new Rectangle(0, table.getHeight() - 1, 1, 1));
                            }
                        }
                    }
                });
View Full Code Here

Examples of javax.swing.RowSorter.SortKey

    * @param column the colummn index.
    * @return the sort icon, or null if the column is unsorted.
    */
   protected Icon getIcon(JTable table, int column)
   {
      SortKey sortKey = getSortKey(table, column);
      if (sortKey != null && sortKey.getColumn() == column) {
         SortOrder sortOrder = sortKey.getSortOrder();
         switch (sortOrder) {
            case ASCENDING:
               return UIManager.getIcon("Table.ascendingSortIcon");
            case DESCENDING:
               return UIManager.getIcon("Table.descendingSortIcon");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.