本文整理匯總了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();
}