Class XTCEContainerContentModelBase

  • Direct Known Subclasses:
    XTCEContainerContentModel, XTCETelecommandContentModel

    public abstract class XTCEContainerContentModelBase
    extends Object
    The base class for the XTCE Container Content models captures the common elements when processing both TM and TC containers.
    Author:
    David Overeem
    • Method Detail

      • getName

        public String getName()
        Accessor to retrieve the name of the container that this model represents.
        Returns:
        String containing a name or an empty string if no name is used.
      • getDescription

        public String getDescription()
        Accessor to retrieve a description of the container that this model represents.
        Returns:
        String containing a description or an empty string if none used.
      • getWarnings

        public List<String> getWarnings()
        Accessor to retrieve the list of warnings when processing this container.
        Returns:
        List of strings containing the warning messages.
      • isValid

        public final boolean isValid()
        Retrieve the container processing validity guess flag. In the event that this flag is false, there will always be a warning message to retrieve from getWarnings().
        Returns:
        boolean indicating if there were issues encountered during the processing that suggest that this data is not usable.
      • getContentList

        public List<XTCEContainerContentEntry> getContentList()
        Accessor to retrieve the container content in a pre-processed series of rows that can be iterated through.
        Returns:
        List of XTCEContainerContentEntry objects.
      • getUserValues

        public List<XTCEContainerEntryValue> getUserValues()
        Retrieve the current applied list of user values.
        Returns:
        List of XTCEContainerEntryValue objects.
      • getTotalSize

        public final long getTotalSize()
        Retrieve the total size/length of this container in bits.
        Returns:
        long containing the bit length of the container
      • getBytesRequired

        public final long getBytesRequired()
        Retrieve the number of bytes necessary to capture the number of bits in this container. When the number of bits is not divisible evenly by 8, then the number of bytes returned may have 1-7 unused bits at the end.
        Returns:
        long containing the minimum number of bytes needed to store the data bits for this container.
      • setShowAllConditionals

        public void setShowAllConditionals​(boolean flag)
        Sets the user preference for showing the depth into conditional containers and aggregate members, including repeats, when the entry item is not currently included by the include condition logic.
        Parameters:
        flag - boolean indicating if the depth should be shown even when the conditional is evaluated to not being present in the container.
      • isProcessingCompatible

        public final boolean isProcessingCompatible​(BitSet rawBits)
                                             throws XTCEDatabaseException
        Retrieve the compatibility of this container with the raw bits provided by the caller to determine if this is the right model object to match the binary.
        Parameters:
        rawBits - BitSet containing the raw binary bits of a container.
        Returns:
        boolean indicating if this container matches the supplied binary based on the inheritance model restrictions.
        Throws:
        XTCEDatabaseException - thrown in the event that the container contents cannot be processed. In the event that the container has already been processed, which is usually the case, then this method cannot throw.
      • encodeContainer

        public final BitSet encodeContainer()
                                     throws XTCEDatabaseException
        Encode a raw binary BitSet from the processed container content model for potential file or wire transmission. The binary will be encoded first from the values processed with a binary or user value set input provided when processing this container or the default/initial values in the database for parameters that do not have an assigned value during container processing.
        Returns:
        BitSet containing the raw bits representing this container and the values of the parameters.
        Throws:
        XTCEDatabaseException - thrown in the event that the container contents cannot be processed. In the event that the container has already been processed, which is usually the case, then this method cannot throw.
      • extractRawValue

        public BitSet extractRawValue​(XTCEContainerContentEntry currentEntry)
                               throws XTCEDatabaseException
        Extracts the raw binary value from a container where the binary of the container has been provided to this object.
        Parameters:
        currentEntry - XTCEContainerContentEntry representing the item that is desired for extraction on this object.
        Returns:
        BitSet which is intended to represent the raw bits.
        Throws:
        XTCEDatabaseException - thrown in the event one of three things occurs. First, the binary is not provided to this object so nothing can be extracted. Second, in the event that the calculated starting bit for this item exceeds the length of the binary provided. Third if the length of the item exceeds the length of the binary provided.
      • reorderItemsByStartBit

        protected void reorderItemsByStartBit()
      • dynamicCountFromUserValue

        protected long dynamicCountFromUserValue​(XTCENamedObject item,
                                                 String form)
      • checkForOverlaps

        protected void checkForOverlaps​(long totalSizeInBits)