APISonar


java.util.ArrayList.clone

> java > util > ArrayList > clone
java APIs util APIs ArrayList APIs clone APIs

Example 1
private ArrayList clauses = new ArrayList();

  public Object clone() {
    Query clone = null;
    try {
      clone = (Query)super.clone();
    } catch (CloneNotSupportedException e) {
      throw new RuntimeException(e);
    }
    clone.clauses = (ArrayList)clauses.clone();
    return clone;
  }
Example 2
private ArrayList<T> myElements;

  public Object clone() {
    try{
      OrderedSet newSet = (OrderedSet)super.clone();
      newSet.myHashSet = (GenericHashSet)myHashSet.clone();
      newSet.myElements = (ArrayList)myElements.clone();
      return newSet;
    }
    catch(CloneNotSupportedException e){
      throw new InternalError();
    }
  }
Example 3
private final ArrayList<Module> toEnable = new ArrayList<Module>();

    synchronized void classLoaderUp(NetigsoModule nm) throws IOException {
        if (toInit != null) {
            toInit.add(nm);
            return;
        }
        List<Module> clone;
        synchronized (toEnable) {
            clone = (List<Module>) toEnable.clone();
            toEnable.clear();
        }
        if (!clone.isEmpty()) {
            getDefault().prepare(Lookup.getDefault(), clone);
        }
        nm.start();
    }
Example 4
private ArrayList<String> identifiers;

    public List<String> getIdentifiers() {
        // don't return a reference to our private array, clone it.
        return (List<String>) identifiers.clone();
    }
Example 5
protected ArrayList list = null;

    public void ensureCapacity(int capacity) {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                temp.ensureCapacity(capacity);
                list = temp;
            }
        } else {
            synchronized (list) {
                list.ensureCapacity(capacity);
            }
        }

    }
Example 6
private ArrayList<Object> values = new ArrayList<>();

  public NutchField clone() throws CloneNotSupportedException {
    NutchField result = (NutchField) super.clone();
    result.weight = weight;
    result.values = (ArrayList<Object>) values.clone();

    return result;
  }
Example 7
private ArrayList<String> issuerNames;

    public Collection<Object> getIssuerNames() {
        if (issuerNames == null) {
            return null;
        }
        return (Collection<Object>) issuerNames.clone();
    }
Example 8
private static ArrayList tokenNames = null;

    List getTokenNames() throws Exception {
        if (tokenNames == null) {
            tokenNames = getTokenNamesNative();
        }
        if (tokenNames == null) {
            tokenNames = new ArrayList();
        }    

        return (List)tokenNames.clone();
    }
Example 9
private final ArrayList<Port> mPorts = new ArrayList<>();

  public List<Port> getOpenPorts(){
    synchronized (mPorts) {
      return (List<Port>) mPorts.clone();
    }
  }
Example 10
private final ArrayList<Object> list;

    protected SessionInfo clone() {
        @SuppressWarnings("unchecked")
        ArrayList<Object> newList = (ArrayList<Object>) list.clone();
        @SuppressWarnings("unchecked")
        TreeSet<String> propIds = (TreeSet<String>) list.get(PROP_IDS);
        if (propIds != null)
            newList.set(PROP_IDS, propIds.clone());
        return new SessionInfo(newList);
    }
Example 11
private ArrayList<BasicPacket> resultPackets = new ArrayList<>(3); // length = "some small number"

    public Object clone() {
        try {
            PacketWrapper other = (PacketWrapper) super.clone();
            other.resultPackets = (ArrayList<BasicPacket>) resultPackets.clone();
            if (packets != null) {
                other.packets = (LinkedHashMap<DocsumPacketKey, BasicPacket>) packets.clone();
            }
            return other;
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException("A non-cloneable superclass has been inserted.",
                    e);
        }
    }
Example 12
private static ArrayList tokenInfoList = null;

    List getTokenInfoList() throws Exception {
        if (tokenInfoList == null) {
            tokenInfoList = getTokenInfoListNative();
            if (tokenInfoList == null) {
                tokenInfoList = new ArrayList();
            }
        }
        return (List)tokenInfoList.clone();
    }
Example 13
private ArrayList<Receiver> receiverList;

    public final List<Receiver> getReceivers() {
        List<Receiver> recs;
        synchronized (traRecLock) {
            if (receiverList == null) {
                recs = Collections.unmodifiableList(new ArrayList<Receiver>(0));
            } else {
                recs = Collections.unmodifiableList
                    ((List<Receiver>) (receiverList.clone()));
            }
        }
        return recs;
    }
Example 14
ArrayList entries;

    @Override public Object clone () {
        lock.readLock().lock();
        try {
            Alphabet ret = new Alphabet();
            ret.map = (ObjectIntHashMap) map.clone();
            ret.entries = (ArrayList) entries.clone();
            ret.growthStopped = growthStopped;
            ret.entryClass = entryClass;
            return ret;
        } finally {
            lock.readLock().unlock();
        }
    }
Example 15
private ArrayList<Action> mActions;

    public RemoteViews clone() {
        final RemoteViews that = new RemoteViews(mPackage, mLayoutId);
        if (mActions != null) {
            that.mActions = (ArrayList<Action>)mActions.clone();
        }
        return that;
    }
Example 16
public static int f(ArrayList list) {
		ArrayList workingList = (ArrayList)list.clone();
		Iterator iter = workingList != null ?workingList.iterator() : null;
		return  workingList.size();
		}
Example 17
public ArrayList<PwEntryV4> history = new ArrayList<PwEntryV4>();

	public PwEntryV4 cloneDeep() {
		PwEntryV4 entry = (PwEntryV4) clone(true);
		
		entry.binaries = (HashMap<String, ProtectedBinary>) binaries.clone();
		entry.history = (ArrayList<PwEntryV4>) history.clone();
		entry.autoType = (AutoType) autoType.clone();

		return entry;
	}
Example 18
private transient ArrayList <ChangeListener> changeListenerList;

    private void fire() {
        path = null;
        java.util.ArrayList list;
        javax.swing.event.ChangeEvent e = new ChangeEvent (this);
        synchronized (this) {
            if (changeListenerList == null) return;
            list = (ArrayList)changeListenerList.clone ();
        }
        for (int i = 0; i < list.size (); i++) {
            ((javax.swing.event.ChangeListener)list.get (i)).stateChanged (e);
        }
    }
Example 19
private /*@ spec_public @*/ ArrayList<Object> m_Values;

  final void addValue(String value) {

    m_Values = Utils.cast(m_Values.clone());
    m_Hashtable = Utils.cast(m_Hashtable.clone());
    forceAddValue(value);
  }
Example 20
final ArrayList<Fragment> mAdded = new ArrayList<>();

    public List<Fragment> getFragments() {
        if (mAdded.isEmpty()) {
            return Collections.emptyList();
        }
        synchronized (mAdded) {
            return (List<Fragment>) mAdded.clone();
        }
    }
Example 21
ArrayList iSavedFields = new ArrayList();

    public Object saveState() {
        Object state = new SavedState();
        iSavedFields = (ArrayList)iSavedFields.clone();
        return state;
    }
Example 22
protected ArrayList physical_addrs=null;

    public Object clone() throws CloneNotSupportedException {
        LogicalAddress ret=new LogicalAddress();
        ret.host=host;
        ret.timestamp=timestamp;
        ret.id=id;
        ret.multicast_addr=multicast_addr;
        ret.additional_data=additional_data;
        ret.primary_physical_addr=primary_physical_addr;
        if(physical_addrs != null)
            ret.physical_addrs=(ArrayList)physical_addrs.clone();
        return ret;
    }
Example 23
private ArrayList<Part> parts=new ArrayList<Part>();

    public MessagePattern cloneAsThawed() {
        MessagePattern newMsg;
        try {
            newMsg=(MessagePattern)super.clone();
        } catch (CloneNotSupportedException e) {
            throw new ICUCloneNotSupportedException(e);
        }
        newMsg.parts=(ArrayList<Part>)parts.clone();
        if(numericValues!=null) {
            newMsg.numericValues=(ArrayList<Double>)numericValues.clone();
        }
        newMsg.frozen=false;
        return newMsg;
    }
Example 24
private ArrayList<String> identifiers;

    public Event(int eventType, int subjectType, UUID subjectID, String detail, ArrayList<String> identifiers) {
        this.eventType = eventType;
        this.subjectType = coreTypeToMask(subjectType);
        this.subjectID = subjectID;
        timeStamp = System.currentTimeMillis();
        this.detail = detail;
        this.identifiers = (ArrayList<String>) identifiers.clone();
    }
Example 25
private ArrayList<OptNode>        _childs  = null;

	public OptNode createShallowClone()
	{
		OptNode n = new OptNode(_ntype,_etype);
		n.setID(_id);
		n.setK(_k);		
		if( _childs != null )
			n.setChilds( (ArrayList<OptNode>)_childs.clone() );
		if( _params != null )
			n.setParams((HashMap<ParamType,String>)_params.clone());
		return n;
	}