public void removeAll(Env env, SplObjectStorage storage)
 {
     for (StringValue hash : storage._objMap.keySet())
     {
         detachImpl(env, hash);
     }
 }
        public void addAll(Env env, SplObjectStorage storage)
        {
            ObjectEntry entry = storage._head;

            while (entry != null)
            {
                attachImpl(env, entry.getHash(), entry.getObject(), entry.getValue());

                entry = entry.getNext();
            }
        }
        public void removeAllExcept(Env env, SplObjectStorage storage)
        {
            ArrayList <ObjectEntry> toRemoveList = new ArrayList <ObjectEntry>();

            ObjectEntry entry = _head;

            while (entry != null)
            {
                if (storage._objMap.containsKey(entry.getHash()))
                {
                }
                else
                {
                    toRemoveList.add(entry);
                }

                entry = entry.getNext();
            }

            for (ObjectEntry listEntry : toRemoveList)
            {
                detachImpl(env, listEntry.getHash());
            }
        }