Add JetBrains license to HashPMap, remove obsolete author tags and javadocs
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package kotlin.reflect.jvm.internal.pcollections;
|
||||
|
||||
import java.util.Iterator;
|
||||
@@ -7,8 +23,6 @@ import java.util.NoSuchElementException;
|
||||
* A simple persistent stack of non-null values.
|
||||
* <p/>
|
||||
* This implementation is thread-safe, although its iterators may not be.
|
||||
*
|
||||
* @author harold
|
||||
*/
|
||||
final class ConsPStack<E> implements Iterable<E> {
|
||||
private static final ConsPStack<Object> EMPTY = new ConsPStack<Object>();
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package kotlin.reflect.jvm.internal.pcollections;
|
||||
|
||||
/**
|
||||
* A persistent map from non-null keys to non-null values.
|
||||
* <p/>
|
||||
* This map uses a given integer map to map hashcodes to lists of elements
|
||||
* with the same hashcode. Thus if all elements have the same hashcode, performance
|
||||
* is reduced to that of an association list.
|
||||
* <p/>
|
||||
* This implementation is thread-safe, although its iterators may not be.
|
||||
*
|
||||
* @author harold
|
||||
*/
|
||||
public final class HashPMap<K, V> {
|
||||
private static final HashPMap<Object, Object> EMPTY = new HashPMap<Object, Object>(IntTreePMap.<ConsPStack<MapEntry<Object, Object>>>empty(), 0);
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package kotlin.reflect.jvm.internal.pcollections;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package kotlin.reflect.jvm.internal.pcollections;
|
||||
|
||||
/**
|
||||
* An efficient persistent map from integer keys to non-null values.
|
||||
* <p/>
|
||||
* Iteration occurs in the integer order of the keys.
|
||||
* <p/>
|
||||
* This implementation is thread-safe, although its iterators may not be.
|
||||
* <p/>
|
||||
* The balanced tree is based on the Glasgow Haskell Compiler's Data.Map implementation,
|
||||
* which in turn is based on "size balanced binary trees" as described by:
|
||||
* <p/>
|
||||
* Stephen Adams, "Efficient sets: a balancing act",
|
||||
* Journal of Functional Programming 3(4):553-562, October 1993,
|
||||
* http://www.swiss.ai.mit.edu/~adams/BB/.
|
||||
* <p/>
|
||||
* J. Nievergelt and E.M. Reingold, "Binary search trees of bounded balance",
|
||||
* SIAM journal of computing 2(1), March 1973.
|
||||
*
|
||||
* @author harold
|
||||
*/
|
||||
final class IntTreePMap<V> {
|
||||
private static final IntTreePMap<Object> EMPTY = new IntTreePMap<Object>(IntTree.EMPTYNODE);
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package kotlin.reflect.jvm.internal.pcollections;
|
||||
|
||||
/**
|
||||
* <p/>
|
||||
* An Entry maintaining an immutable key and value. This class
|
||||
* does not support method <tt>setValue</tt>. This class may be
|
||||
* convenient in methods that return thread-safe snapshots of
|
||||
* key-value mappings.
|
||||
*/
|
||||
final class MapEntry<K, V> implements java.io.Serializable {
|
||||
private static final long serialVersionUID = 7138329143949025153L;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user