blob: 767885f764e6ea230c19c586e47753dbea33d58d [file] [log] [blame]
/*
* Copyright (C) 2017 The Android Open Source Project
*
* 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 android.location.cts.asn1.supl2.rrlp_components;
/*
*/
//
//
import android.location.cts.asn1.base.Asn1Integer;
import android.location.cts.asn1.base.Asn1Null;
import android.location.cts.asn1.base.Asn1Object;
import android.location.cts.asn1.base.Asn1Sequence;
import android.location.cts.asn1.base.Asn1Tag;
import android.location.cts.asn1.base.BitStream;
import android.location.cts.asn1.base.BitStreamReader;
import android.location.cts.asn1.base.SequenceComponent;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import javax.annotation.Nullable;
/**
*/
public class GANSSIonosphereModel extends Asn1Sequence {
//
private static final Asn1Tag TAG_GANSSIonosphereModel
= Asn1Tag.fromClassAndNumber(-1, -1);
public GANSSIonosphereModel() {
super();
}
@Override
@Nullable
protected Asn1Tag getTag() {
return TAG_GANSSIonosphereModel;
}
@Override
protected boolean isTagImplicit() {
return true;
}
public static Collection<Asn1Tag> getPossibleFirstTags() {
if (TAG_GANSSIonosphereModel != null) {
return ImmutableList.of(TAG_GANSSIonosphereModel);
} else {
return Asn1Sequence.getPossibleFirstTags();
}
}
/**
* Creates a new GANSSIonosphereModel from encoded stream.
*/
public static GANSSIonosphereModel fromPerUnaligned(byte[] encodedBytes) {
GANSSIonosphereModel result = new GANSSIonosphereModel();
result.decodePerUnaligned(new BitStreamReader(encodedBytes));
return result;
}
/**
* Creates a new GANSSIonosphereModel from encoded stream.
*/
public static GANSSIonosphereModel fromPerAligned(byte[] encodedBytes) {
GANSSIonosphereModel result = new GANSSIonosphereModel();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
}
@Override protected boolean isExtensible() {
return false;
}
@Override public boolean containsExtensionValues() {
for (SequenceComponent extensionComponent : getExtensionComponents()) {
if (extensionComponent.isExplicitlySet()) return true;
}
return false;
}
private GANSSIonosphereModel.ai0Type ai0_;
public GANSSIonosphereModel.ai0Type getAi0() {
return ai0_;
}
/**
* @throws ClassCastException if value is not a GANSSIonosphereModel.ai0Type
*/
public void setAi0(Asn1Object value) {
this.ai0_ = (GANSSIonosphereModel.ai0Type) value;
}
public GANSSIonosphereModel.ai0Type setAi0ToNewInstance() {
ai0_ = new GANSSIonosphereModel.ai0Type();
return ai0_;
}
private GANSSIonosphereModel.ai1Type ai1_;
public GANSSIonosphereModel.ai1Type getAi1() {
return ai1_;
}
/**
* @throws ClassCastException if value is not a GANSSIonosphereModel.ai1Type
*/
public void setAi1(Asn1Object value) {
this.ai1_ = (GANSSIonosphereModel.ai1Type) value;
}
public GANSSIonosphereModel.ai1Type setAi1ToNewInstance() {
ai1_ = new GANSSIonosphereModel.ai1Type();
return ai1_;
}
private GANSSIonosphereModel.ai2Type ai2_;
public GANSSIonosphereModel.ai2Type getAi2() {
return ai2_;
}
/**
* @throws ClassCastException if value is not a GANSSIonosphereModel.ai2Type
*/
public void setAi2(Asn1Object value) {
this.ai2_ = (GANSSIonosphereModel.ai2Type) value;
}
public GANSSIonosphereModel.ai2Type setAi2ToNewInstance() {
ai2_ = new GANSSIonosphereModel.ai2Type();
return ai2_;
}
@Override public Iterable<? extends SequenceComponent> getComponents() {
ImmutableList.Builder<SequenceComponent> builder = ImmutableList.builder();
builder.add(new SequenceComponent() {
Asn1Tag tag = Asn1Tag.fromClassAndNumber(2, 0);
@Override public boolean isExplicitlySet() {
return getAi0() != null;
}
@Override public boolean hasDefaultValue() {
return false;
}
@Override public boolean isOptional() {
return false;
}
@Override public Asn1Object getComponentValue() {
return getAi0();
}
@Override public void setToNewInstance() {
setAi0ToNewInstance();
}
@Override public Collection<Asn1Tag> getPossibleFirstTags() {
return tag == null ? GANSSIonosphereModel.ai0Type.getPossibleFirstTags() : ImmutableList.of(tag);
}
@Override
public Asn1Tag getTag() {
return tag;
}
@Override
public boolean isImplicitTagging() {
return true;
}
@Override public String toIndentedString(String indent) {
return "ai0 : "
+ getAi0().toIndentedString(indent);
}
});
builder.add(new SequenceComponent() {
Asn1Tag tag = Asn1Tag.fromClassAndNumber(2, 1);
@Override public boolean isExplicitlySet() {
return getAi1() != null;
}
@Override public boolean hasDefaultValue() {
return false;
}
@Override public boolean isOptional() {
return false;
}
@Override public Asn1Object getComponentValue() {
return getAi1();
}
@Override public void setToNewInstance() {
setAi1ToNewInstance();
}
@Override public Collection<Asn1Tag> getPossibleFirstTags() {
return tag == null ? GANSSIonosphereModel.ai1Type.getPossibleFirstTags() : ImmutableList.of(tag);
}
@Override
public Asn1Tag getTag() {
return tag;
}
@Override
public boolean isImplicitTagging() {
return true;
}
@Override public String toIndentedString(String indent) {
return "ai1 : "
+ getAi1().toIndentedString(indent);
}
});
builder.add(new SequenceComponent() {
Asn1Tag tag = Asn1Tag.fromClassAndNumber(2, 2);
@Override public boolean isExplicitlySet() {
return getAi2() != null;
}
@Override public boolean hasDefaultValue() {
return false;
}
@Override public boolean isOptional() {
return false;
}
@Override public Asn1Object getComponentValue() {
return getAi2();
}
@Override public void setToNewInstance() {
setAi2ToNewInstance();
}
@Override public Collection<Asn1Tag> getPossibleFirstTags() {
return tag == null ? GANSSIonosphereModel.ai2Type.getPossibleFirstTags() : ImmutableList.of(tag);
}
@Override
public Asn1Tag getTag() {
return tag;
}
@Override
public boolean isImplicitTagging() {
return true;
}
@Override public String toIndentedString(String indent) {
return "ai2 : "
+ getAi2().toIndentedString(indent);
}
});
return builder.build();
}
@Override public Iterable<? extends SequenceComponent>
getExtensionComponents() {
ImmutableList.Builder<SequenceComponent> builder = ImmutableList.builder();
return builder.build();
}
/*
*/
//
/**
*/
public static class ai0Type extends Asn1Integer {
//
private static final Asn1Tag TAG_ai0Type
= Asn1Tag.fromClassAndNumber(-1, -1);
public ai0Type() {
super();
setValueRange("0", "4095");
}
@Override
@Nullable
protected Asn1Tag getTag() {
return TAG_ai0Type;
}
@Override
protected boolean isTagImplicit() {
return true;
}
public static Collection<Asn1Tag> getPossibleFirstTags() {
if (TAG_ai0Type != null) {
return ImmutableList.of(TAG_ai0Type);
} else {
return Asn1Integer.getPossibleFirstTags();
}
}
/**
* Creates a new ai0Type from encoded stream.
*/
public static ai0Type fromPerUnaligned(byte[] encodedBytes) {
ai0Type result = new ai0Type();
result.decodePerUnaligned(new BitStreamReader(encodedBytes));
return result;
}
/**
* Creates a new ai0Type from encoded stream.
*/
public static ai0Type fromPerAligned(byte[] encodedBytes) {
ai0Type result = new ai0Type();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
}
@Override public Iterable<BitStream> encodePerUnaligned() {
return super.encodePerUnaligned();
}
@Override public Iterable<BitStream> encodePerAligned() {
return super.encodePerAligned();
}
@Override public void decodePerUnaligned(BitStreamReader reader) {
super.decodePerUnaligned(reader);
}
@Override public void decodePerAligned(BitStreamReader reader) {
super.decodePerAligned(reader);
}
@Override public String toString() {
return toIndentedString("");
}
public String toIndentedString(String indent) {
return "ai0Type = " + getInteger() + ";\n";
}
}
/*
*/
//
/**
*/
public static class ai1Type extends Asn1Integer {
//
private static final Asn1Tag TAG_ai1Type
= Asn1Tag.fromClassAndNumber(-1, -1);
public ai1Type() {
super();
setValueRange("0", "4095");
}
@Override
@Nullable
protected Asn1Tag getTag() {
return TAG_ai1Type;
}
@Override
protected boolean isTagImplicit() {
return true;
}
public static Collection<Asn1Tag> getPossibleFirstTags() {
if (TAG_ai1Type != null) {
return ImmutableList.of(TAG_ai1Type);
} else {
return Asn1Integer.getPossibleFirstTags();
}
}
/**
* Creates a new ai1Type from encoded stream.
*/
public static ai1Type fromPerUnaligned(byte[] encodedBytes) {
ai1Type result = new ai1Type();
result.decodePerUnaligned(new BitStreamReader(encodedBytes));
return result;
}
/**
* Creates a new ai1Type from encoded stream.
*/
public static ai1Type fromPerAligned(byte[] encodedBytes) {
ai1Type result = new ai1Type();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
}
@Override public Iterable<BitStream> encodePerUnaligned() {
return super.encodePerUnaligned();
}
@Override public Iterable<BitStream> encodePerAligned() {
return super.encodePerAligned();
}
@Override public void decodePerUnaligned(BitStreamReader reader) {
super.decodePerUnaligned(reader);
}
@Override public void decodePerAligned(BitStreamReader reader) {
super.decodePerAligned(reader);
}
@Override public String toString() {
return toIndentedString("");
}
public String toIndentedString(String indent) {
return "ai1Type = " + getInteger() + ";\n";
}
}
/*
*/
//
/**
*/
public static class ai2Type extends Asn1Integer {
//
private static final Asn1Tag TAG_ai2Type
= Asn1Tag.fromClassAndNumber(-1, -1);
public ai2Type() {
super();
setValueRange("0", "4095");
}
@Override
@Nullable
protected Asn1Tag getTag() {
return TAG_ai2Type;
}
@Override
protected boolean isTagImplicit() {
return true;
}
public static Collection<Asn1Tag> getPossibleFirstTags() {
if (TAG_ai2Type != null) {
return ImmutableList.of(TAG_ai2Type);
} else {
return Asn1Integer.getPossibleFirstTags();
}
}
/**
* Creates a new ai2Type from encoded stream.
*/
public static ai2Type fromPerUnaligned(byte[] encodedBytes) {
ai2Type result = new ai2Type();
result.decodePerUnaligned(new BitStreamReader(encodedBytes));
return result;
}
/**
* Creates a new ai2Type from encoded stream.
*/
public static ai2Type fromPerAligned(byte[] encodedBytes) {
ai2Type result = new ai2Type();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
}
@Override public Iterable<BitStream> encodePerUnaligned() {
return super.encodePerUnaligned();
}
@Override public Iterable<BitStream> encodePerAligned() {
return super.encodePerAligned();
}
@Override public void decodePerUnaligned(BitStreamReader reader) {
super.decodePerUnaligned(reader);
}
@Override public void decodePerAligned(BitStreamReader reader) {
super.decodePerAligned(reader);
}
@Override public String toString() {
return toIndentedString("");
}
public String toIndentedString(String indent) {
return "ai2Type = " + getInteger() + ";\n";
}
}
@Override public Iterable<BitStream> encodePerUnaligned() {
return super.encodePerUnaligned();
}
@Override public Iterable<BitStream> encodePerAligned() {
return super.encodePerAligned();
}
@Override public void decodePerUnaligned(BitStreamReader reader) {
super.decodePerUnaligned(reader);
}
@Override public void decodePerAligned(BitStreamReader reader) {
super.decodePerAligned(reader);
}
@Override public String toString() {
return toIndentedString("");
}
public String toIndentedString(String indent) {
StringBuilder builder = new StringBuilder();
builder.append("GANSSIonosphereModel = {\n");
final String internalIndent = indent + " ";
for (SequenceComponent component : getComponents()) {
if (component.isExplicitlySet()) {
builder.append(internalIndent)
.append(component.toIndentedString(internalIndent));
}
}
if (isExtensible()) {
builder.append(internalIndent).append("...\n");
for (SequenceComponent component : getExtensionComponents()) {
if (component.isExplicitlySet()) {
builder.append(internalIndent)
.append(component.toIndentedString(internalIndent));
}
}
}
builder.append(indent).append("};\n");
return builder.toString();
}
}