Skip to content

Commit

Permalink
[Java] Add some missing use of Serializable. Issue #223.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Oct 2, 2020
1 parent cb97cda commit 9f4b17f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ public void remove()
/**
* Iterator over keys which supports access to unboxed keys via {@link #nextValue()}.
*/
public final class KeyIterator extends AbstractIterator implements Iterator<Integer>
public final class KeyIterator extends AbstractIterator implements Iterator<Integer>, Serializable
{
public Integer next()
{
Expand All @@ -828,7 +828,7 @@ public int nextValue()
/**
* Iterator over values which supports access to unboxed values.
*/
public final class ValueIterator extends AbstractIterator implements Iterator<Integer>
public final class ValueIterator extends AbstractIterator implements Iterator<Integer>, Serializable
{
public Integer next()
{
Expand All @@ -852,7 +852,7 @@ public int nextValue()
*/
public final class EntryIterator
extends AbstractIterator
implements Iterator<Entry<Integer, Integer>>, Entry<Integer, Integer>
implements Iterator<Entry<Integer, Integer>>, Entry<Integer, Integer>, Serializable
{
public Integer getKey()
{
Expand Down Expand Up @@ -1087,7 +1087,7 @@ public boolean contains(final int key)
/**
* Collection of values which supports optionally cached iterators to avoid allocation.
*/
public final class ValueCollection extends AbstractCollection<Integer>
public final class ValueCollection extends AbstractCollection<Integer> implements Serializable
{
private final ValueIterator valueIterator = shouldAvoidAllocation ? new ValueIterator() : null;

Expand Down
10 changes: 5 additions & 5 deletions agrona/src/main/java/org/agrona/collections/Int2ObjectCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public void clear()
/**
* Collection of values which supports cached iterator to avoid allocation.
*/
public final class ValueCollection extends AbstractCollection<V>
public final class ValueCollection extends AbstractCollection<V> implements Serializable
{
private final ValueIterator iterator = new ValueIterator();

Expand Down Expand Up @@ -658,7 +658,7 @@ public void clear()
/**
* Set of entries which supports cached iterator to avoid allocation.
*/
public final class EntrySet extends AbstractSet<Map.Entry<Integer, V>>
public final class EntrySet extends AbstractSet<Map.Entry<Integer, V>> implements Serializable
{
private final EntryIterator iterator = new EntryIterator();

Expand Down Expand Up @@ -751,7 +751,7 @@ void reset()
/**
* An iterator over values.
*/
public final class ValueIterator extends AbstractIterator<V>
public final class ValueIterator extends AbstractIterator<V> implements Serializable
{
@SuppressWarnings("unchecked")
public V next()
Expand All @@ -764,7 +764,7 @@ public V next()
/**
* Iterator over keys which supports access to unboxed keys via {@link #nextInt()}.
*/
public final class KeyIterator extends AbstractIterator<Integer>
public final class KeyIterator extends AbstractIterator<Integer> implements Serializable
{
public Integer next()
{
Expand All @@ -788,7 +788,7 @@ public int nextInt()
*/
public final class EntryIterator
extends AbstractIterator<Entry<Integer, V>>
implements Entry<Integer, V>
implements Entry<Integer, V>, Serializable
{
public Entry<Integer, V> next()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ final void reset()
/**
* Iterator over values.
*/
public class ValueIterator extends AbstractIterator<V>
public class ValueIterator extends AbstractIterator<V> implements Serializable
{
public V next()
{
Expand All @@ -1007,7 +1007,7 @@ public V next()
/**
* Iterator over keys which supports access to unboxed keys via {@link #nextInt()}.
*/
public class KeyIterator extends AbstractIterator<Integer>
public class KeyIterator extends AbstractIterator<Integer> implements Serializable
{
public Integer next()
{
Expand All @@ -1032,7 +1032,7 @@ public int nextInt()
*/
public class EntryIterator
extends AbstractIterator<Entry<Integer, V>>
implements Entry<Integer, V>
implements Entry<Integer, V>, Serializable
{
public Entry<Integer, V> next()
{
Expand Down Expand Up @@ -1091,7 +1091,7 @@ public V setValue(final V value)
/**
* An {@link java.util.Map.Entry} implementation.
*/
public final class MapEntry implements Entry<Integer, V>
public final class MapEntry implements Entry<Integer, V>, Serializable
{
private final int k;
private final V v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ final void reset()
/**
* Iterator over values providing unboxed access via {@link #nextInt()}.
*/
public final class ValueIterator extends AbstractIterator<Integer>
public final class ValueIterator extends AbstractIterator<Integer> implements Serializable
{
public Integer next()
{
Expand All @@ -972,7 +972,7 @@ public int nextInt()
/**
* Iterator over keys.
*/
public final class KeyIterator extends AbstractIterator<K>
public final class KeyIterator extends AbstractIterator<K> implements Serializable
{
public K next()
{
Expand All @@ -986,7 +986,7 @@ public K next()
*/
public final class EntryIterator
extends AbstractIterator<Entry<K, Integer>>
implements Entry<K, Integer>
implements Entry<K, Integer>, Serializable
{
public Entry<K, Integer> next()
{
Expand Down Expand Up @@ -1053,7 +1053,7 @@ public int setValue(final int value)
/**
* An {@link java.util.Map.Entry} implementation.
*/
public final class MapEntry implements Entry<K, Integer>
public final class MapEntry implements Entry<K, Integer>, Serializable
{
private final K k;
private final int v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public void remove()
/**
* An iterator over keys.
*/
public final class KeyIterator extends AbstractIterator implements Iterator<K>
public final class KeyIterator extends AbstractIterator implements Iterator<K>, Serializable
{
@SuppressWarnings("unchecked")
public K next()
Expand All @@ -645,7 +645,7 @@ public K next()
/**
* An iterator over values.
*/
public final class ValueIterator extends AbstractIterator implements Iterator<V>
public final class ValueIterator extends AbstractIterator implements Iterator<V>, Serializable
{
public V next()
{
Expand All @@ -659,7 +659,7 @@ public V next()
*/
public final class EntryIterator
extends AbstractIterator
implements Iterator<Entry<K, V>>, Entry<K, V>
implements Iterator<Entry<K, V>>, Entry<K, V>, Serializable
{
@SuppressWarnings("unchecked")
public K getKey()
Expand Down Expand Up @@ -869,7 +869,7 @@ public void forEach(final Consumer<? super K> action)
/**
* A collection of values.
*/
public final class ValueCollection extends AbstractCollection<V>
public final class ValueCollection extends AbstractCollection<V> implements Serializable
{
private final ValueIterator valueIterator = shouldAvoidAllocation ? new ValueIterator() : null;

Expand Down

0 comments on commit 9f4b17f

Please sign in to comment.