org.ccsds.moims.mo.mal.structures.AreaNumber Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-mal Show documentation
Show all versions of api-mal Show documentation
An implementation of the Java API for the CCSDS MAL
package org.ccsds.moims.mo.mal.structures;
/**
* Enumeration class for AreaNumber.
*/
public final class AreaNumber extends org.ccsds.moims.mo.mal.structures.Enumeration {
/**
* Short form for type.
*/
public static final Integer TYPE_SHORT_FORM = 105;
/**
* Short form for area.
*/
public static final org.ccsds.moims.mo.mal.structures.UShort AREA_SHORT_FORM = new org.ccsds.moims.mo.mal.structures.UShort(1);
/**
* Version for area.
*/
public static final org.ccsds.moims.mo.mal.structures.UOctet AREA_VERSION = new org.ccsds.moims.mo.mal.structures.UOctet((short) 1);
/**
* Short form for service.
*/
public static final org.ccsds.moims.mo.mal.structures.UShort SERVICE_SHORT_FORM = new org.ccsds.moims.mo.mal.structures.UShort(0);
/**
* Absolute short form for type.
*/
public static final Long SHORT_FORM = 281474993487977L;
private static final long serialVersionUID = 281474993487977L;
/**
* Enumeration ordinal index for value MAL.
*/
public static final int _MAL_INDEX = 0;
/**
* Enumeration numeric value for value MAL.
*/
public static final org.ccsds.moims.mo.mal.structures.UInteger MAL_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(1);
/**
* Enumeration singleton for value MAL.
*/
public static final org.ccsds.moims.mo.mal.structures.AreaNumber MAL = new org.ccsds.moims.mo.mal.structures.AreaNumber(org.ccsds.moims.mo.mal.structures.AreaNumber._MAL_INDEX);
/**
* Enumeration ordinal index for value COM.
*/
public static final int _COM_INDEX = 1;
/**
* Enumeration numeric value for value COM.
*/
public static final org.ccsds.moims.mo.mal.structures.UInteger COM_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(2);
/**
* Enumeration singleton for value COM.
*/
public static final org.ccsds.moims.mo.mal.structures.AreaNumber COM = new org.ccsds.moims.mo.mal.structures.AreaNumber(org.ccsds.moims.mo.mal.structures.AreaNumber._COM_INDEX);
/**
* Enumeration ordinal index for value COMMON.
*/
public static final int _COMMON_INDEX = 2;
/**
* Enumeration numeric value for value COMMON.
*/
public static final org.ccsds.moims.mo.mal.structures.UInteger COMMON_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(3);
/**
* Enumeration singleton for value COMMON.
*/
public static final org.ccsds.moims.mo.mal.structures.AreaNumber COMMON = new org.ccsds.moims.mo.mal.structures.AreaNumber(org.ccsds.moims.mo.mal.structures.AreaNumber._COMMON_INDEX);
/**
* Enumeration ordinal index for value MC.
*/
public static final int _MC_INDEX = 3;
/**
* Enumeration numeric value for value MC.
*/
public static final org.ccsds.moims.mo.mal.structures.UInteger MC_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(4);
/**
* Enumeration singleton for value MC.
*/
public static final org.ccsds.moims.mo.mal.structures.AreaNumber MC = new org.ccsds.moims.mo.mal.structures.AreaNumber(org.ccsds.moims.mo.mal.structures.AreaNumber._MC_INDEX);
/**
* Enumeration ordinal index for value MPS.
*/
public static final int _MPS_INDEX = 4;
/**
* Enumeration numeric value for value MPS.
*/
public static final org.ccsds.moims.mo.mal.structures.UInteger MPS_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(5);
/**
* Enumeration singleton for value MPS.
*/
public static final org.ccsds.moims.mo.mal.structures.AreaNumber MPS = new org.ccsds.moims.mo.mal.structures.AreaNumber(org.ccsds.moims.mo.mal.structures.AreaNumber._MPS_INDEX);
/**
* Enumeration ordinal index for value SM.
*/
public static final int _SM_INDEX = 5;
/**
* Enumeration numeric value for value SM.
*/
public static final org.ccsds.moims.mo.mal.structures.UInteger SM_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(7);
/**
* Enumeration singleton for value SM.
*/
public static final org.ccsds.moims.mo.mal.structures.AreaNumber SM = new org.ccsds.moims.mo.mal.structures.AreaNumber(org.ccsds.moims.mo.mal.structures.AreaNumber._SM_INDEX);
/**
* Enumeration ordinal index for value MDPD.
*/
public static final int _MDPD_INDEX = 6;
/**
* Enumeration numeric value for value MDPD.
*/
public static final org.ccsds.moims.mo.mal.structures.UInteger MDPD_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(9);
/**
* Enumeration singleton for value MDPD.
*/
public static final org.ccsds.moims.mo.mal.structures.AreaNumber MDPD = new org.ccsds.moims.mo.mal.structures.AreaNumber(org.ccsds.moims.mo.mal.structures.AreaNumber._MDPD_INDEX);
/**
* Set of enumeration instances.
*/
private static final org.ccsds.moims.mo.mal.structures.AreaNumber[] _ENUMERATIONS = {MAL, COM, COMMON, MC, MPS, SM, MDPD};
/**
* Set of enumeration string values.
*/
private static final String[] _ENUMERATION_NAMES = {"MAL", "COM", "COMMON", "MC", "MPS", "SM", "MDPD"};
/**
* Set of enumeration values.
*/
private static final org.ccsds.moims.mo.mal.structures.UInteger[] _ENUMERATION_NUMERIC_VALUES = {MAL_NUM_VALUE, COM_NUM_VALUE, COMMON_NUM_VALUE, MC_NUM_VALUE, MPS_NUM_VALUE, SM_NUM_VALUE, MDPD_NUM_VALUE};
/**
*
* @param ordinal null.
*/
private AreaNumber(int ordinal) {
super(ordinal);
}
/**
* Returns a String object representing this type's value.
*
* @return a string representation of the value of this object.
*/
public String toString() {
switch (getOrdinal()) {
case _MAL_INDEX:
return "MAL";
case _COM_INDEX:
return "COM";
case _COMMON_INDEX:
return "COMMON";
case _MC_INDEX:
return "MC";
case _MPS_INDEX:
return "MPS";
case _SM_INDEX:
return "SM";
case _MDPD_INDEX:
return "MDPD";
default:
throw new RuntimeException("Unknown ordinal!");
}
}
/**
* Returns the enumeration element represented by the supplied string, or null if not
* matched.
*
* @param s s The string to search for.
* @return The matched enumeration element, or null if not matched.
*/
public static org.ccsds.moims.mo.mal.structures.AreaNumber fromString(String s) {
for (int i = 0; i < _ENUMERATION_NAMES.length; i++) {
if (_ENUMERATION_NAMES[i].equals(s)) {
return _ENUMERATIONS[i];
}
}
return null;
}
/**
* Returns the nth element of the enumeration.
*
* @param ordinal ordinal The index of the enumeration element to return.
* @return The matched enumeration element.
*/
public static org.ccsds.moims.mo.mal.structures.AreaNumber fromOrdinal(int ordinal) {
return _ENUMERATIONS[ordinal];
}
/**
* Returns the enumeration element represented by the supplied numeric value, or null
* if not matched.
*
* @param value value The numeric value to search for.
* @return The matched enumeration value, or null if not matched.
*/
public static org.ccsds.moims.mo.mal.structures.AreaNumber fromNumericValue(org.ccsds.moims.mo.mal.structures.UInteger value) {
for (int i = 0; i < _ENUMERATION_NUMERIC_VALUES.length; i++) {
if (_ENUMERATION_NUMERIC_VALUES[i].equals(value)) {
return _ENUMERATIONS[i];
}
}
return null;
}
/**
* Returns the index of the enumerated item as a {@code UOctet}.
*
* @return the index of the enumerated item as a {@code UOctet}.
*/
public org.ccsds.moims.mo.mal.structures.UOctet getOrdinalUOctet() {
return new org.ccsds.moims.mo.mal.structures.UOctet(ordinal.shortValue());
}
/**
* Returns the numeric value of the enumeration element.
*
* @return The numeric value.
*/
public org.ccsds.moims.mo.mal.structures.UInteger getNumericValue() {
return _ENUMERATION_NUMERIC_VALUES[ordinal];
}
/**
* Returns an instance of this type using the first element of the enumeration. It is
* a generic factory method but just returns an existing element of the enumeration
* as new values of enumerations cannot be created at runtime.
*
* @return The first element of the enumeration.
*/
public org.ccsds.moims.mo.mal.structures.Element createElement() {
return _ENUMERATIONS[0];
}
/**
* Encodes the value of this object using the provided MALEncoder.
*
* @param encoder encoder - the encoder to use for encoding.
* @throws org.ccsds.moims.mo.mal.MALException if any encoding errors are detected.
*/
public void encode(org.ccsds.moims.mo.mal.MALEncoder encoder) throws org.ccsds.moims.mo.mal.MALException {
encoder.encodeUOctet(new org.ccsds.moims.mo.mal.structures.UOctet(ordinal.shortValue()));
}
/**
* Decodes the value of this object using the provided MALDecoder.
*
* @param decoder decoder - the decoder to use for decoding.
* @return Returns this object.
* @throws org.ccsds.moims.mo.mal.MALException if any decoding errors are detected.
*/
public org.ccsds.moims.mo.mal.structures.Element decode(org.ccsds.moims.mo.mal.MALDecoder decoder) throws org.ccsds.moims.mo.mal.MALException {
return fromOrdinal(decoder.decodeUOctet().getValue());
}
/**
* Returns the absolute short form of this type.
*
* @return The absolute short form of this type.
*/
public Long getShortForm() {
return SHORT_FORM;
}
/**
* Returns the type short form of this type which is unique to the area/service it is
* defined in but not unique across all types.
*
* @return The type short form of this type.
*/
public Integer getTypeShortForm() {
return TYPE_SHORT_FORM;
}
/**
* Returns the area number of this type.
*
* @return The area number of this type.
*/
public org.ccsds.moims.mo.mal.structures.UShort getAreaNumber() {
return AREA_SHORT_FORM;
}
/**
* Returns the area version of this type.
*
* @return The area number of this type.
*/
public org.ccsds.moims.mo.mal.structures.UOctet getAreaVersion() {
return AREA_VERSION;
}
/**
* Returns the service number of this type.
*
* @return The service number of this type.
*/
public org.ccsds.moims.mo.mal.structures.UShort getServiceNumber() {
return SERVICE_SHORT_FORM;
}
}