@Override public TreeSortedSet<T> clone() { try { TreeSortedSet<T> clone = (TreeSortedSet<T>) super.clone(); clone.treeSet = (TreeSet<T>) this.treeSet.clone(); return clone; } catch (CloneNotSupportedException e) { throw new AssertionError(e); } }
@Override public TreeSortedSet<T> clone() { try { TreeSortedSet<T> clone = (TreeSortedSet<T>) super.clone(); clone.treeSet = (TreeSet<T>) this.treeSet.clone(); return clone; } catch (CloneNotSupportedException e) { throw new AssertionError(e); } }
@Override public TreeSortedSet<T> clone() { try { TreeSortedSet<T> clone = (TreeSortedSet<T>) super.clone(); clone.treeSet = (TreeSet<T>) this.treeSet.clone(); return clone; } catch (CloneNotSupportedException e) { throw new AssertionError(e); } }
/** * @return a StringBuffer containing all the LogRecords in the recordSet * (isn't too big ?) */ private TreeSet fetchRecordsSet() { TreeSet myset = null; synchronized (recordSet) { myset = (TreeSet) recordSet.clone(); } return myset; }
/** * Factory for create the copy of current degrees collection. */ @SuppressWarnings("unchecked") protected TreeSet<BigInteger> createDegreesCollectionCopy() { return (TreeSet<BigInteger>) this.degrees.clone(); }
@Override public Object clone () { return super.clone(); //To change body of generated methods, choose Tools | Templates. } }
@Override public Object clone () { return super.clone(); //To change body of generated methods, choose Tools | Templates. } }
@SuppressWarnings("unchecked") public SortedSet<VisualPropertySheetItem<?>> getItems() { return (SortedSet<VisualPropertySheetItem<?>>) items.clone(); }
/** * Clone a package set * * @param toClone set to clone * @return the cloned package set */ public static Set clonePackageSet(Object toClone) { TreeSet original = (TreeSet) toClone; return (Set) original.clone(); }
/** * Clone a package set * * @param toClone set to clone * @return the cloned package set */ public static Set clonePackageSet(Object toClone) { TreeSet original = (TreeSet) toClone; return (Set) original.clone(); }
/** * @return a StringBuffer containing all the LogRecords in the recordSet * (isn't too big ?) */ private TreeSet fetchRecordsSet() { TreeSet myset = null; synchronized (recordSet) { myset = (TreeSet) recordSet.clone(); } return myset; }
/** * Gets the contact groups. The returned collection is sorted. It should not be shared. * * @return The contact groups. */ @SuppressWarnings("unchecked") public final synchronized Collection<ContactGroup> getContactGroups() { // return defensive copies of mutable internal fields return Collections.unmodifiableCollection((TreeSet<ContactGroup>) groups.clone()); }
/** * Creates and returns a copy of this object. * @return The cloned object */ public Object clone() { if (useCache) { loadFromStore(); } return delegate.clone(); }
/** * Creates and returns a copy of this object. * @return The cloned object */ public Object clone() { if (useCache) { loadFromStore(); } return delegate.clone(); }
public Set<E> newColl(Collection<E> c) { if(c instanceof TreeSet/*<E>*/) { @SuppressWarnings("unchecked") TreeSet<E> result = (TreeSet<E>) ((TreeSet<E>) c).clone(); return result; } return super.newColl(c); } }
@SuppressWarnings("unchecked") public static <E> Collection<E> duplicateCollection(Collection<E> original) { if (original instanceof HashSet) return (Set<E>) ((HashSet<E>) original).clone(); if (original instanceof TreeSet) return (Set<E>) ((TreeSet<E>) original).clone(); return attemptClone(original); }
@SuppressWarnings("unchecked") private static <T extends Collection> T attemptKnownSetCopy(T set) { if (set instanceof LinkedHashSet) return (T) ((LinkedHashSet) set).clone(); if (set instanceof HashSet) return (T) ((HashSet) set).clone(); if (set instanceof TreeSet) return (T) ((TreeSet) set).clone(); return null; }