Remove trailing spaces.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1477753 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7d9196da0e
commit
315b0c786f
|
@ -47,7 +47,7 @@ public abstract class AbstractKeyValue<K, V> implements KeyValue<K, V> {
|
|||
/**
|
||||
* Gets the key from the pair.
|
||||
*
|
||||
* @return the key
|
||||
* @return the key
|
||||
*/
|
||||
public K getKey() {
|
||||
return key;
|
||||
|
@ -76,7 +76,7 @@ public abstract class AbstractKeyValue<K, V> implements KeyValue<K, V> {
|
|||
|
||||
/**
|
||||
* Gets a debugging String view of the pair.
|
||||
*
|
||||
*
|
||||
* @return a String view of the entry
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -57,7 +57,7 @@ public abstract class AbstractMapEntry<K, V> extends AbstractKeyValue<K, V> impl
|
|||
* Compares this <code>Map.Entry</code> with another <code>Map.Entry</code>.
|
||||
* <p>
|
||||
* Implemented per API documentation of {@link java.util.Map.Entry#equals(Object)}
|
||||
*
|
||||
*
|
||||
* @param obj the object to compare to
|
||||
* @return true if equal key and value
|
||||
*/
|
||||
|
@ -79,13 +79,13 @@ public abstract class AbstractMapEntry<K, V> extends AbstractKeyValue<K, V> impl
|
|||
* Gets a hashCode compatible with the equals method.
|
||||
* <p>
|
||||
* Implemented per API documentation of {@link java.util.Map.Entry#hashCode()}
|
||||
*
|
||||
*
|
||||
* @return a suitable hash code
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (getKey() == null ? 0 : getKey().hashCode()) ^
|
||||
(getValue() == null ? 0 : getValue().hashCode());
|
||||
(getValue() == null ? 0 : getValue().hashCode());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.commons.collections4.KeyValue;
|
|||
* @version $Id$
|
||||
*/
|
||||
public abstract class AbstractMapEntryDecorator<K, V> implements Map.Entry<K, V>, KeyValue<K, V> {
|
||||
|
||||
|
||||
/** The <code>Map.Entry</code> to decorate */
|
||||
private final Map.Entry<K, V> entry;
|
||||
|
||||
|
@ -47,7 +47,7 @@ public abstract class AbstractMapEntryDecorator<K, V> implements Map.Entry<K, V>
|
|||
|
||||
/**
|
||||
* Gets the map being decorated.
|
||||
*
|
||||
*
|
||||
* @return the decorated map
|
||||
*/
|
||||
protected Map.Entry<K, V> getMapEntry() {
|
||||
|
@ -55,7 +55,7 @@ public abstract class AbstractMapEntryDecorator<K, V> implements Map.Entry<K, V>
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
public K getKey() {
|
||||
return entry.getKey();
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public abstract class AbstractMapEntryDecorator<K, V> implements Map.Entry<K, V>
|
|||
public V setValue(final V object) {
|
||||
return entry.setValue(object);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object object) {
|
||||
if (object == this) {
|
||||
|
|
|
@ -86,7 +86,7 @@ public class DefaultKeyValue<K, V> extends AbstractKeyValue<K, V> {
|
|||
return super.setKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Sets the value.
|
||||
*
|
||||
* @return the old value of the value
|
||||
|
@ -105,7 +105,7 @@ public class DefaultKeyValue<K, V> extends AbstractKeyValue<K, V> {
|
|||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns a new <code>Map.Entry</code> object with key and value from this pair.
|
||||
*
|
||||
*
|
||||
* @return a MapEntry instance
|
||||
*/
|
||||
public Map.Entry<K, V> toMapEntry() {
|
||||
|
@ -118,7 +118,7 @@ public class DefaultKeyValue<K, V> extends AbstractKeyValue<K, V> {
|
|||
* <p>
|
||||
* Returns true if the compared object is also a <code>DefaultKeyValue</code>,
|
||||
* and its key and value are equal to this object's key and value.
|
||||
*
|
||||
*
|
||||
* @param obj the object to compare to
|
||||
* @return true if equal key and value
|
||||
*/
|
||||
|
@ -132,7 +132,7 @@ public class DefaultKeyValue<K, V> extends AbstractKeyValue<K, V> {
|
|||
}
|
||||
|
||||
final DefaultKeyValue<?, ?> other = (DefaultKeyValue<?, ?>) obj;
|
||||
return
|
||||
return
|
||||
(getKey() == null ? other.getKey() == null : getKey().equals(other.getKey())) &&
|
||||
(getValue() == null ? other.getValue() == null : getValue().equals(other.getValue()));
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public class DefaultKeyValue<K, V> extends AbstractKeyValue<K, V> {
|
|||
* <p>
|
||||
* Implemented per API documentation of {@link java.util.Map.Entry#hashCode()},
|
||||
* however subclasses may override this.
|
||||
*
|
||||
*
|
||||
* @return a suitable hash code
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -19,11 +19,11 @@ package org.apache.commons.collections4.keyvalue;
|
|||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
/**
|
||||
* A <code>MultiKey</code> allows multiple map keys to be merged together.
|
||||
* <p>
|
||||
* The purpose of this class is to avoid the need to write code to handle
|
||||
* maps of maps. An example might be the need to look up a file name by
|
||||
* maps of maps. An example might be the need to look up a file name by
|
||||
* key and locale. The typical solution might be nested maps. This class
|
||||
* can be used instead by creating an instance passing in the key and locale.
|
||||
* <p>
|
||||
|
@ -58,7 +58,7 @@ public class MultiKey<K> implements Serializable {
|
|||
* <p>
|
||||
* The keys should be immutable
|
||||
* If they are not then they must not be changed after adding to the MultiKey.
|
||||
*
|
||||
*
|
||||
* @param key1 the first key
|
||||
* @param key2 the second key
|
||||
*/
|
||||
|
@ -72,7 +72,7 @@ public class MultiKey<K> implements Serializable {
|
|||
* <p>
|
||||
* The keys should be immutable
|
||||
* If they are not then they must not be changed after adding to the MultiKey.
|
||||
*
|
||||
*
|
||||
* @param key1 the first key
|
||||
* @param key2 the second key
|
||||
* @param key3 the third key
|
||||
|
@ -87,7 +87,7 @@ public class MultiKey<K> implements Serializable {
|
|||
* <p>
|
||||
* The keys should be immutable
|
||||
* If they are not then they must not be changed after adding to the MultiKey.
|
||||
*
|
||||
*
|
||||
* @param key1 the first key
|
||||
* @param key2 the second key
|
||||
* @param key3 the third key
|
||||
|
@ -103,7 +103,7 @@ public class MultiKey<K> implements Serializable {
|
|||
* <p>
|
||||
* The keys should be immutable
|
||||
* If they are not then they must not be changed after adding to the MultiKey.
|
||||
*
|
||||
*
|
||||
* @param key1 the first key
|
||||
* @param key2 the second key
|
||||
* @param key3 the third key
|
||||
|
@ -174,7 +174,7 @@ public class MultiKey<K> implements Serializable {
|
|||
* <p>
|
||||
* The keys should be immutable
|
||||
* If they are not then they must not be changed.
|
||||
*
|
||||
*
|
||||
* @return the individual keys
|
||||
*/
|
||||
public K[] getKeys() {
|
||||
|
@ -186,7 +186,7 @@ public class MultiKey<K> implements Serializable {
|
|||
* <p>
|
||||
* The key should be immutable.
|
||||
* If it is not then it must not be changed.
|
||||
*
|
||||
*
|
||||
* @param index the index to retrieve
|
||||
* @return the key at the index
|
||||
* @throws IndexOutOfBoundsException if the index is invalid
|
||||
|
@ -198,7 +198,7 @@ public class MultiKey<K> implements Serializable {
|
|||
|
||||
/**
|
||||
* Gets the size of the list of keys.
|
||||
*
|
||||
*
|
||||
* @return the size of the list of keys
|
||||
* @since 3.1
|
||||
*/
|
||||
|
@ -212,7 +212,7 @@ public class MultiKey<K> implements Serializable {
|
|||
* <p>
|
||||
* To be equal, the other object must be a <code>MultiKey</code> with the
|
||||
* same number of keys which are also equal.
|
||||
*
|
||||
*
|
||||
* @param other the other object to compare to
|
||||
* @return true if equal
|
||||
*/
|
||||
|
@ -232,10 +232,10 @@ public class MultiKey<K> implements Serializable {
|
|||
* Gets the combined hash code that is computed from all the keys.
|
||||
* <p>
|
||||
* This value is computed once and then cached, so elements should not
|
||||
* change their hash codes once created (note that this is the same
|
||||
* change their hash codes once created (note that this is the same
|
||||
* constraint that would be used if the individual keys elements were
|
||||
* themselves {@link java.util.Map Map} keys.
|
||||
*
|
||||
*
|
||||
* @return the hash code
|
||||
*/
|
||||
@Override
|
||||
|
@ -245,7 +245,7 @@ public class MultiKey<K> implements Serializable {
|
|||
|
||||
/**
|
||||
* Gets a debugging string version of the key.
|
||||
*
|
||||
*
|
||||
* @return a debugging string
|
||||
*/
|
||||
@Override
|
||||
|
@ -267,11 +267,11 @@ public class MultiKey<K> implements Serializable {
|
|||
}
|
||||
hashCode = total;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recalculate the hash code after deserialization. The hash code of some
|
||||
* keys might have change (hash codes based on the system hash code are
|
||||
* only stable for the same process).
|
||||
* only stable for the same process).
|
||||
* @return the instance with recalculated hash code
|
||||
*/
|
||||
private Object readResolve() {
|
||||
|
|
|
@ -32,10 +32,10 @@ import org.apache.commons.collections4.KeyValue;
|
|||
*/
|
||||
public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = -8453869361373831205L;
|
||||
|
||||
/** The map underlying the entry/iterator */
|
||||
/** The map underlying the entry/iterator */
|
||||
private final Map<K, V> map;
|
||||
|
||||
/** The key */
|
||||
|
@ -57,7 +57,7 @@ public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Seri
|
|||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Gets the key of this entry
|
||||
*
|
||||
*
|
||||
* @return the key
|
||||
*/
|
||||
public K getKey() {
|
||||
|
@ -66,7 +66,7 @@ public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Seri
|
|||
|
||||
/**
|
||||
* Gets the value of this entry direct from the map.
|
||||
*
|
||||
*
|
||||
* @return the value
|
||||
*/
|
||||
public V getValue() {
|
||||
|
@ -75,7 +75,7 @@ public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Seri
|
|||
|
||||
/**
|
||||
* Sets the value associated with the key direct onto the map.
|
||||
*
|
||||
*
|
||||
* @param value the new value
|
||||
* @return the old value
|
||||
* @throws IllegalArgumentException if the value is set to this map entry
|
||||
|
@ -91,7 +91,7 @@ public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Seri
|
|||
* Compares this <code>Map.Entry</code> with another <code>Map.Entry</code>.
|
||||
* <p>
|
||||
* Implemented per API documentation of {@link java.util.Map.Entry#equals(Object)}
|
||||
*
|
||||
*
|
||||
* @param obj the object to compare to
|
||||
* @return true if equal key and value
|
||||
*/
|
||||
|
@ -114,19 +114,19 @@ public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Seri
|
|||
* Gets a hashCode compatible with the equals method.
|
||||
* <p>
|
||||
* Implemented per API documentation of {@link java.util.Map.Entry#hashCode()}
|
||||
*
|
||||
*
|
||||
* @return a suitable hash code
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final Object value = getValue();
|
||||
return (getKey() == null ? 0 : getKey().hashCode()) ^
|
||||
(value == null ? 0 : value.hashCode());
|
||||
(value == null ? 0 : value.hashCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a string version of the entry.
|
||||
*
|
||||
*
|
||||
* @return entry as a string
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -62,7 +62,7 @@ public final class UnmodifiableMapEntry<K, V> extends AbstractMapEntry<K, V> imp
|
|||
|
||||
/**
|
||||
* Throws UnsupportedOperationException.
|
||||
*
|
||||
*
|
||||
* @param value the new value
|
||||
* @return the previous value
|
||||
* @throws UnsupportedOperationException always
|
||||
|
|
Loading…
Reference in New Issue