Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
*/
package org.apache.directory.api.util;


import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.AbstractCollection;
import java.util.AbstractSet;
import java.util.ArrayList;
Expand Down Expand Up @@ -58,11 +53,8 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
@SuppressWarnings("rawtypes")
public class SequencedHashMap implements Map, Cloneable, Externalizable
public class SequencedHashMap implements Map
{
/** Declares the Serial Version Uid */
private static final long serialVersionUID = 3380552487888102930L;

// constants to define what the iterator should return on "next"
/** The iterator will return the key */
private static final int KEY = 0;
Expand Down Expand Up @@ -1336,48 +1328,4 @@ public Object remove( int index )
return remove( get( index ) );
}


// per Externalizable.readExternal(ObjectInput)

/**
* Deserializes this map from the given stream.
*
* @param in
* the stream to deserialize from
* @throws IOException
* if the stream raises it
* @throws ClassNotFoundException
* if the stream raises it
*/
@Override
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
int size = in.readInt();
for ( int i = 0; i < size; i++ )
{
Object key = in.readObject();
Object value = in.readObject();
put( key, value );
}
}


/**
* Serializes this map to the given stream.
*
* @param out
* the stream to serialize to
* @throws IOException
* if the stream raises it
*/
@Override
public void writeExternal( ObjectOutput out ) throws IOException
{
out.writeInt( size() );
for ( MapEntry pos = sentinel.next; pos != sentinel; pos = pos.next )
{
out.writeObject( pos.getKey() );
out.writeObject( pos.getValue() );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
*/
package org.apache.directory.api.util;


import java.io.Externalizable;


/**
* <p>
* An implementation of a Map which has a maximum size and uses a Least Recently
Expand All @@ -45,10 +41,8 @@
* @since Commons Collections 1.0
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public final class SynchronizedLRUMap extends SequencedHashMap implements Externalizable
public final class SynchronizedLRUMap extends SequencedHashMap
{
/** Declares the Serial Version Uid */
private static final long serialVersionUID = 2197433140769957051L;

/** Maximum size */
private int maximumSize = 0;
Expand Down
Loading