本文整理汇总了Java中java.util.LinkedList.clone方法的典型用法代码示例。如果您正苦于以下问题:Java LinkedList.clone方法的具体用法?Java LinkedList.clone怎么用?Java LinkedList.clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.LinkedList
的用法示例。
在下文中一共展示了LinkedList.clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FileListAdapter
import java.util.LinkedList; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public FileListAdapter(final Context context,
final LinkedList<FileDetail> fileDetails,
final boolean isRoot,
FileAdapterListener fileAdapterListener) {
this.fileAdapterListener = fileAdapterListener;
this.fileDetails = fileDetails;
this.originalFileList = (LinkedList<FileDetail>) fileDetails.clone();
this.orig = fileDetails;
this.inflater = LayoutInflater.from(context);
if (!isRoot) {
this.fileDetails.addFirst(new FileDetail("..", context.getString(R.string.folder), ""));
} else {
this.fileDetails.addFirst(new FileDetail(context.getString(R.string.home), context.getString(R.string.folder), ""));
}
}
示例2: parse
import java.util.LinkedList; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public ExpressionTree parse( LinkedList<Token> toks ) throws ParserException {
if( toks.size() == 0 ) {
return null;
}
tokens = (LinkedList<Token>) toks.clone(); //safe cast
lookahead = tokens.getFirst();
ExpressionTree tree = expression();
if( lookahead.token != Token.EPSILON ) {
throw new ParserException("Unexpected symbol " +lookahead.sequence+ " found");
}
if( tree == null ) {
throw new ParserException("No tree was generated");
}
return tree;
}
示例3: cloneCollection
import java.util.LinkedList; //导入方法依赖的package包/类
/**
*
*/
@SuppressWarnings("unchecked")
public LinkedList<V> cloneCollection(LinkedList<V> collection) {
return (LinkedList<V>)collection.clone();
}