本文整理汇总了Python中java.util.Collections.reverse方法的典型用法代码示例。如果您正苦于以下问题:Python Collections.reverse方法的具体用法?Python Collections.reverse怎么用?Python Collections.reverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Collections
的用法示例。
在下文中一共展示了Collections.reverse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _GetCurrentASTPath
# 需要导入模块: from java.util import Collections [as 别名]
# 或者: from java.util.Collections import reverse [as 别名]
def _GetCurrentASTPath(context, reverse=False):
'''
@return: ArrayList(SimpleNode)
'''
from org.python.pydev.parser.fastparser import FastParser
selection = _CreateSelection(context)
ret = FastParser.parseToKnowGloballyAccessiblePath(
context.getDocument(), selection.getStartLineIndex())
if reverse:
from java.util import Collections
Collections.reverse(ret)
return ret
示例2: extract_content_between_block_level_nodes
# 需要导入模块: from java.util import Collections [as 别名]
# 或者: from java.util.Collections import reverse [as 别名]
def extract_content_between_block_level_nodes(self, doc):
"""
Shows how to extract the content between a paragraph and table using the ExtractContent method.
"""
startPara = doc.getLastSection().getChild(NodeType.PARAGRAPH, 2, True)
endTable = doc.getLastSection().getChild(NodeType.TABLE, 0, True)
# Extract the content between these nodes in the document. Include these markers in the extraction.
extractedNodes = self.extract_contents(startPara, endTable, True)
# Lets reverse the array to make inserting the content back into the document easier.
Collections.reverse(extractedNodes[::-1])
while (len(extractedNodes) > 0):
# Insert the last node from the reversed list
endTable.getParentNode().insertAfter(extractedNodes[0], endTable)
# Remove this node from the list after insertion.
del extractedNodes[0]
# Save the generated document to disk.
doc.save(self.dataDir + "TestFile.DuplicatedContent Out.doc")