當前位置: 首頁>>代碼示例>>Java>>正文


Java SortDir類代碼示例

本文整理匯總了Java中org.onosproject.ui.table.TableModel.SortDir的典型用法代碼示例。如果您正苦於以下問題:Java SortDir類的具體用法?Java SortDir怎麽用?Java SortDir使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SortDir類屬於org.onosproject.ui.table.TableModel包,在下文中一共展示了SortDir類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sortAndFormat

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortAndFormat() {
    initUnsortedTable();

    // set hex formatter
    tm.setFormatter(BAR, HexFormatter.INSTANCE);

    // sort by number
    tm.sort(BAR, SortDir.ASC, null, null);

    // verify results
    rows = tm.getRows();
    int nr = rows.length;
    assertEquals("row count", SORTED_HEX.length, nr);
    for (int i = 0; i < nr; i++) {
        assertEquals(UNEX_SORT + i, SORTED_HEX[i], rows[i].getAsString(BAR));
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:19,代碼來源:TableModelTest.java

示例2: enumSort

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void enumSort() {
    tm = new TableModel(FOO);
    tm.addRow().cell(FOO, StarWars.HAN_SOLO);
    tm.addRow().cell(FOO, StarWars.C3PO);
    tm.addRow().cell(FOO, StarWars.JABBA_THE_HUTT);
    tm.addRow().cell(FOO, StarWars.LEIA_ORGANA);
    tm.addRow().cell(FOO, StarWars.R2D2);
    tm.addRow().cell(FOO, StarWars.LUKE_SKYWALKER);

    tm.sort(FOO, SortDir.ASC, null, null);

    // verify expected results
    StarWars[] ordered = StarWars.values();
    TableModel.Row[] rows = tm.getRows();
    assertEquals("wrong length?", ordered.length, rows.length);
    int nr = rows.length;
    for (int i = 0; i < nr; i++) {
        assertEquals(UNEX_SORT + i, ordered[i], rows[i].get(FOO));
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:22,代碼來源:TableModelTest.java

示例3: tableStringSort

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void tableStringSort() {
    initUnsortedTable();

    // sort by name
    tm.sort(FOO, SortDir.ASC, null, null);

    // verify results
    rows = tm.getRows();
    int nr = rows.length;
    assertEquals("row count", NAMES.length, nr);
    for (int i = 0; i < nr; i++) {
        assertEquals(UNEX_SORT + i, SORTED_NAMES[i], rows[i].get(FOO));
    }

    // now the other way
    tm.sort(FOO, SortDir.DESC, null, null);

    // verify results
    rows = tm.getRows();
    nr = rows.length;
    assertEquals("row count", NAMES.length, nr);
    for (int i = 0; i < nr; i++) {
        assertEquals(UNEX_SORT + i,
                     SORTED_NAMES[nr - 1 - i], rows[i].get(FOO));
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:28,代碼來源:TableModelTest.java

示例4: tableNumberSort

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void tableNumberSort() {
    initUnsortedTable();

    // sort by number
    tm.sort(BAR, SortDir.ASC, null, null);

    // verify results
    rows = tm.getRows();
    int nr = rows.length;
    assertEquals("row count", NUMBERS.length, nr);
    for (int i = 0; i < nr; i++) {
        assertEquals(UNEX_SORT + i, SORTED_NUMBERS[i], rows[i].get(BAR));
    }

    // now the other way
    tm.sort(BAR, SortDir.DESC, null, null);

    // verify results
    rows = tm.getRows();
    nr = rows.length;
    assertEquals("row count", NUMBERS.length, nr);
    for (int i = 0; i < nr; i++) {
        assertEquals(UNEX_SORT + i,
                     SORTED_NUMBERS[nr - 1 - i], rows[i].get(BAR));
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:28,代碼來源:TableModelTest.java

示例5: sortAndFormatTwo

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortAndFormatTwo() {
    initUnsortedTable();
    tm.setFormatter(BAR, HexFormatter.INSTANCE);
    tm.sort(FOO, SortDir.ASC, null, null);
    rows = tm.getRows();
    int nr = rows.length;
    for (int i = 0; i < nr; i++) {
        String[] exp = SORTED_NAMES_AND_HEX[i];
        String[] act = rows[i].getAsFormattedStrings();
        assertArrayEquals(UNEX_SORT + i, exp, act);
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:14,代碼來源:TableModelTest.java

示例6: sortAlphaAscNumberAsc

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortAlphaAscNumberAsc() {
    tm = unsortedDoubleTableModel();
    verifyRowOrder("unsorted", tm, UNSORTED_IDS);
    tm.sort(ALPHA, SortDir.ASC, NUMBER, SortDir.ASC);
    verifyRowOrder("aana", tm, ROW_ORDER_AA_NA);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:8,代碼來源:TableModelTest.java

示例7: sortAlphaDescNumberAsc

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortAlphaDescNumberAsc() {
    tm = unsortedDoubleTableModel();
    verifyRowOrder("unsorted", tm, UNSORTED_IDS);
    tm.sort(ALPHA, SortDir.DESC, NUMBER, SortDir.ASC);
    verifyRowOrder("adna", tm, ROW_ORDER_AD_NA);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:8,代碼來源:TableModelTest.java

示例8: sortAlphaAscNumberDesc

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortAlphaAscNumberDesc() {
    tm = unsortedDoubleTableModel();
    verifyRowOrder("unsorted", tm, UNSORTED_IDS);
    tm.sort(ALPHA, SortDir.ASC, NUMBER, SortDir.DESC);
    verifyRowOrder("aand", tm, ROW_ORDER_AA_ND);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:8,代碼來源:TableModelTest.java

示例9: sortAlphaDescNumberDesc

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortAlphaDescNumberDesc() {
    tm = unsortedDoubleTableModel();
    verifyRowOrder("unsorted", tm, UNSORTED_IDS);
    tm.sort(ALPHA, SortDir.DESC, NUMBER, SortDir.DESC);
    verifyRowOrder("adnd", tm, ROW_ORDER_AD_ND);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:8,代碼來源:TableModelTest.java

示例10: sortDirAsc

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortDirAsc() {
    assertEquals("asc sort dir", SortDir.ASC, TableModel.sortDir("asc"));
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:TableModelTest.java

示例11: sortDirDesc

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortDirDesc() {
    assertEquals("desc sort dir", SortDir.DESC, TableModel.sortDir("desc"));
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:TableModelTest.java

示例12: sortDirOther

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortDirOther() {
    assertEquals("other sort dir", SortDir.ASC, TableModel.sortDir("other"));
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:TableModelTest.java

示例13: sortDirNull

import org.onosproject.ui.table.TableModel.SortDir; //導入依賴的package包/類
@Test
public void sortDirNull() {
    assertEquals("null sort dir", SortDir.ASC, TableModel.sortDir(null));
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:TableModelTest.java


注:本文中的org.onosproject.ui.table.TableModel.SortDir類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。