/** * Create a new {@code ParseState} whose {@link LinkedList} is a {@link Object#clone clone} * of that of the passed in {@code ParseState}. */ @SuppressWarnings("unchecked") private ParseState(ParseState other) { this.state = (LinkedList<Entry>) other.state.clone(); }
/** * Create a new {@code ParseState} whose {@link LinkedList} is a {@link Object#clone clone} * of that of the passed in {@code ParseState}. */ @SuppressWarnings("unchecked") private ParseState(ParseState other) { this.state = (LinkedList<Entry>) other.state.clone(); }
/** * Clones this set. * * @return Clone of this set. * @throws CloneNotSupportedException */ @Override protected Object clone() throws CloneNotSupportedException { GridListSet<V> clone = (GridListSet<V>)super.clone(); clone.vals = (LinkedList<V>)vals.clone(); clone.comp = comp; clone.strict = strict; return clone; }
/** * Attempts to use native {@link Object#clone()} methods on available map * types. If a list cannot be properly cloned, a new {@link ArrayList} is * returned. * * @param list The list input * @param <T> The value type * @return A copied list */ @SuppressWarnings("unchecked") public static <T> List<T> copyList(List<? extends T> list) { try { if (list instanceof ArrayList) { return (List<T>) ((ArrayList<? extends T>) list).clone(); } else if (list instanceof LinkedList) { return (List<T>) ((LinkedList<? extends T>) list).clone(); } else if (list instanceof CopyOnWriteArrayList) { return (List<T>) ((CopyOnWriteArrayList<T>) list).clone(); } } catch (Exception ignored) { } return new ArrayList<>(list); }
/** * Initializes file walking. * Separates input files and folders. */ protected void init() { rules.detectMode(); todoFiles = new LinkedList<>(); todoFolders = new LinkedList<>(); if (pathList == null) { pathList = new LinkedList<>(); return; } if (pathListOriginal == null) { pathListOriginal = (LinkedList<File>) pathList.clone(); } String[] files = new String[pathList.size()]; int index = 0; Iterator<File> iterator = pathList.iterator(); while (iterator.hasNext()) { File file = iterator.next(); if (file.isFile()) { files[index++] = file.getAbsolutePath(); iterator.remove(); } } if (index != 0) { FilesIterator filesIterator = new FilesIterator(files); todoFiles.add(filesIterator); } }
@Override public ReqEntity getEntity() { MultipartSubtype type = jd_options.getSelectedSubtype(); MultipartMode mode = jd_options.getSelectedMode(); ReqEntity entity = new ReqEntityMultipartBean( (LinkedList<ReqEntityPart>)model.list.clone(), mode, type); return entity; }
filteredMessageClone = (LinkedList<Object>) filteredMessage.clone();
private final LinkedList cloneOfUnused() { assert Thread.holdsLock( this ); return (LinkedList) unused.clone(); }
@SuppressWarnings("unchecked") public Iterator<Peer> getIterator() { final List<Peer> clone = (LinkedList<Peer>) this.peerList.clone(); final List<Peer> tmpList = clone; return tmpList.iterator(); }
@SuppressWarnings("unchecked") public synchronized Object clone() throws CloneNotSupportedException { NestableGroup clone = (NestableGroup) super.clone(); if(clone != null) clone.rolesStack = (LinkedList<Principal>)this.rolesStack.clone(); return clone; }
@SuppressWarnings({"unchecked", "rawtypes"}) public synchronized Object clone() throws CloneNotSupportedException { NestablePrincipal clone = (NestablePrincipal) super.clone(); if(clone != null) clone.principalStack = (LinkedList)this.principalStack.clone(); return clone; }
LinkedList l1 = new LinkedList(); l1.add("A");l1.add("B"); LinkedList l2 = (LinkedList)l1.clone(); out("l2 after clone: "+l2.size()); l2.remove(0); out("l2 after remove: "+l2.size()); l1 = (LinkedList)l2.clone(); out("l1 cloned from l2: "+l1.size()); l1.remove(0); out("l1 after remove :"+l1.size()); out("l2 after l1's remove:"+l2.size());
@Override public AndIt clone() throws CloneNotSupportedException { AndIt answer = (AndIt) super.clone(); answer.buffer = this.buffer.clone(); answer.ll = (LinkedList<IteratingRLW32>) this.ll.clone(); return answer; }
@Override public BufferedAndIterator clone() throws CloneNotSupportedException { BufferedAndIterator answer = (BufferedAndIterator) super.clone(); answer.buffer = this.buffer.clone(); answer.ll = (LinkedList<IteratingRLW>) this.ll.clone(); return answer; }
public WikiPagePath copy() { WikiPagePath clone = new WikiPagePath(); clone.names = (LinkedList<String>) names.clone(); clone.mode = mode; return clone; }
@Override public XORIt clone() throws CloneNotSupportedException { XORIt answer = (XORIt) super.clone(); answer.buffer = this.buffer.clone(); answer.hardbitmap = this.hardBitmap.clone(); answer.ll = (LinkedList<IteratingRLW32>) this.ll.clone(); return answer; }
@Override public BufferedXORIterator clone() throws CloneNotSupportedException { BufferedXORIterator answer = (BufferedXORIterator) super .clone(); answer.buffer = this.buffer.clone(); answer.hardbitmap = this.hardBitmap.clone(); answer.ll = (LinkedList<IteratingRLW>) this.ll.clone(); return answer; }
@Override public BufferedXORIterator clone() throws CloneNotSupportedException { BufferedXORIterator answer = (BufferedXORIterator) super.clone(); answer.buffer = this.buffer.clone(); answer.hardbitmap = this.hardbitmap.clone(); answer.ll = (LinkedList<IteratingRLW>) this.ll.clone(); return answer; }
@Override public XORIt clone() throws CloneNotSupportedException { XORIt answer = (XORIt) super.clone(); answer.buffer = this.buffer.clone(); answer.hardbitmap = this.hardbitmap.clone(); answer.ll = (LinkedList<IteratingRLW32>) this.ll.clone(); return answer; }
@Override public BufferedXORIterator clone() throws CloneNotSupportedException { BufferedXORIterator answer = (BufferedXORIterator) super.clone(); answer.buffer = this.buffer.clone(); answer.hardbitmap = this.hardbitmap.clone(); answer.ll = (LinkedList<IteratingRLW>) this.ll.clone(); return answer; }