本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.reverse方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.reverse方法的具体用法?Java ContainerUtil.reverse怎么用?Java ContainerUtil.reverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.reverse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reverseParents
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static TimedVcsCommit reverseParents(@NotNull final TimedVcsCommit commit) {
return new TimedVcsCommit() {
@Override
public long getTimestamp() {
return commit.getTimestamp();
}
@NotNull
@Override
public Hash getId() {
return commit.getId();
}
@NotNull
@Override
public List<Hash> getParents() {
return ContainerUtil.reverse(commit.getParents());
}
};
}
示例2: getResult
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public List<Integer> getResult() {
while (prepareLastPartsForBranches()) {
step();
}
return ContainerUtil.reverse(myInverseResultList);
}
示例3: removeSelectedItems
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static List<Object[]> removeSelectedItems(@NotNull JTable table, @Nullable ItemChecker applyable) {
final TableModel model = table.getModel();
if (!(model instanceof ItemRemovable)) {
throw new RuntimeException("model must be instance of ItemRemovable");
}
if (table.getSelectionModel().isSelectionEmpty()) {
return new ArrayList<Object[]>(0);
}
final List<Object[]> removedItems = new SmartList<Object[]>();
final ItemRemovable itemRemovable = (ItemRemovable)model;
final int columnCount = model.getColumnCount();
doRemoveSelectedItems(table, new ItemRemovable() {
@Override
public void removeRow(int index) {
Object[] row = new Object[columnCount];
for (int column = 0; column < columnCount; column++) {
row[column] = model.getValueAt(index, column);
}
removedItems.add(row);
itemRemovable.removeRow(index);
}
}, applyable);
return ContainerUtil.reverse(removedItems);
}
示例4: reverseCollection
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static <T> List<T> reverseCollection(Collection<T> infos) {
return ContainerUtil.reverse(infos instanceof List ? (List<T>)infos : new ArrayList<T>(infos));
}
示例5: actionPerformed
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
List<VcsRevisionNumber> revisions = getRevisionNumbersFromContext(e);
revisions = ContainerUtil.reverse(revisions); // we want hashes from old to new, e.g. to be able to pass to native client in terminal
CopyPasteManager.getInstance().setContents(new StringSelection(getHashesAsString(revisions)));
}