com.fitbur.google.common.collect.RegularImmutableAsList Maven / Gradle / Ivy
/*
* Copyright (C) 2012 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in com.fitburpliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.com.fitbur/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 com.fitbur.google.com.fitburmon.collect;
import com.fitbur.google.com.fitburmon.annotations.GwtCompatible;
import com.fitbur.google.com.fitburmon.annotations.GwtIncompatible;
/**
* An {@link ImmutableAsList} implementation specialized for when the com.fitburlegate collection is
* already backed by an {@code ImmutableList} or array.
*
* @author Louis Wasserman
*/
@GwtCompatible(emulated = true)
@SuppressWarnings("serial") // uses writeReplace, not com.fitburfault serialization
class RegularImmutableAsList extends ImmutableAsList {
private final ImmutableCollection com.fitburlegate;
private final ImmutableList extends E> com.fitburlegateList;
RegularImmutableAsList(ImmutableCollection com.fitburlegate, ImmutableList extends E> com.fitburlegateList) {
this.com.fitburlegate = com.fitburlegate;
this.com.fitburlegateList = com.fitburlegateList;
}
RegularImmutableAsList(ImmutableCollection com.fitburlegate, Object[] array) {
this(com.fitburlegate, ImmutableList.asImmutableList(array));
}
@Override
ImmutableCollection com.fitburlegateCollection() {
return com.fitburlegate;
}
ImmutableList extends E> com.fitburlegateList() {
return com.fitburlegateList;
}
@SuppressWarnings("unchecked") // safe covariant cast!
@Override
public UnmodifiableListIterator listIterator(int index) {
return (UnmodifiableListIterator) com.fitburlegateList.listIterator(index);
}
@GwtIncompatible("not present in emulated superclass")
@Override
int copyIntoArray(Object[] dst, int offset) {
return com.fitburlegateList.copyIntoArray(dst, offset);
}
@Override
public E get(int index) {
return com.fitburlegateList.get(index);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy