Package org.xtce.toolkit
Class XTCEContainerContentEntry
- java.lang.Object
-
- org.xtce.toolkit.XTCEContainerContentEntry
-
- All Implemented Interfaces:
Cloneable,Comparable
public class XTCEContainerContentEntry extends Object implements Comparable, Cloneable
This class represents a single data entry resolved from an XTCETMContainer, which represents a SequenceContainer in the XTCE data model.- Author:
- David Overeem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXTCEContainerContentEntry.FieldTypeEnumeration type to describe the nature of an entry item on a container or telecommand table and/or drawing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Objectclone()Make a copy of this entry by copying all the references included.intcompareTo(Object obj)Comparison Operator This function is used for sorting XTCEContainerContentEntry by their start bit while safely ignoring those that do not have a start bit set.XTCEArgumentgetArgument()Retrieve the XTCEArgument that is represented by this entry, or a null pointer if this entry is not based on an XTCEArgument.List<XTCEContainerEntryValue>getConditionList()Retrieve the list of include conditions that are applied to this entry in the container model.StringgetConditions()Retrieve a string representation of the list of include conditions that are applied to this entry in the container model.XTCEContainerContentEntry.FieldTypegetEntryType()Retrieve the type of entry that this object represents in the overall container as the native enumeration type.StringgetEntryTypeString()Retrieve the type of entry that this object represents in the overall container as a string.XTCETMContainergetHoldingContainer()Retrieve the XTCETMContainer that is represented by this entry, or a null pointer if this entry is not a XTCETMContainer within another XTCETMContainer.StringgetInitialValue()Retrieve the initial/default value for this entry in the container stream, or an empty string if none is defined.StringgetItemFullPath()Retrieve the Fully Qualified Name of the item for which this entry is associated, which can be an Argument, Parameter, or Container name.StringgetName()Retrieve the Name of the item for which this entry is associated, which can be an Argument, Parameter, or Container name.XTCEParametergetParameter()Retrieve the XTCEParameter that is represented by this entry, or a null pointer if this entry is not based on an XTCEParameter.StringgetRawSizeInBits()Retrieve the size in bits that this entry occupies in the container stream, or an empty string if this entry is "information only", such as another container or a telecommand entry.StringgetRepeatParameterInfo()Retrieve the repeating condition for this entry.StringgetStartBit()Retrieve the start bit that this entry occupies in the container stream, or an empty string if this entry is "information only", such as another container or a telecommand entry.XTCETelecommandgetTelecommand()Retrieve the XTCETelecommand that is represented by this entry, or a null pointer if this entry is not based on an XTCETelecommand.XTCETCContainergetTelecommandContainer()Retrieve the XTCETCContainer that is represented by this entry, or a null pointer if this entry is not based on an XTCETCContainer.XTCETMContainergetTelemetryContainer()Retrieve the XTCETMContainer that is represented by this entry, or a null pointer if this entry is not based on an XTCETMContainer.XTCEContainerEntryValuegetValue()Retrieves the value that is set or restricted on this entry based on ArgumentAssignment, RestrictionCriteria, or user chosen set values.booleanisCurrentlyInUse()Retrieve the "in use" attribute of this entry.voidsetCondition(XTCEParameter parameter, ComparisonType compare)Sets the include condition for this entry, which is always based on a Parameter in a ComparisonType element from the XTCE data model.voidsetConditionList(List<XTCEContainerEntryValue> allConditions, boolean entryInUse)Sets the include condition list based on it already being evaluated.voidsetCurrentlyInUse(boolean useFlag)Sets the "in use" attribute of this entry.voidsetRepeatparameterInfo(String repeatString)Sets the repeating condition for this entry.voidsetStartBit(long startBitValue)Sets the start bit for this entry in the container stream.voidsetStartBit(String startBitValue)Sets the start bit for this entry in the container stream.voidsetValue(ComparisonType compare)Sets a value for this entry based on a RestrictionCriteria by passing the ComparisonType from the XTCE data model.voidsetValue(MetaCommandType.BaseMetaCommand.ArgumentAssignmentList.ArgumentAssignment argAssign)Sets a value for this entry based on a ArgumentAssignment by passing the ArgumentAssignment from the XTCE data model.voidsetValue(XTCEContainerEntryValue userValue)Sets a value for this entry based on a XTCEContainerEntryValue from this toolkit.
-
-
-
Method Detail
-
getName
public final String getName()
Retrieve the Name of the item for which this entry is associated, which can be an Argument, Parameter, or Container name.- Returns:
- String containing the name.
-
getItemFullPath
public final String getItemFullPath()
Retrieve the Fully Qualified Name of the item for which this entry is associated, which can be an Argument, Parameter, or Container name.- Returns:
- String containing the name.
-
getTelemetryContainer
public final XTCETMContainer getTelemetryContainer()
Retrieve the XTCETMContainer that is represented by this entry, or a null pointer if this entry is not based on an XTCETMContainer. It is recommended that users check the type of this entry using the provided methods prior to using the getters to retrieve underlying objects.- Returns:
- XTCETMContainer reference to the container represented by this entry or a null pointer.
- See Also:
getEntryType()
-
getTelecommandContainer
public final XTCETCContainer getTelecommandContainer()
Retrieve the XTCETCContainer that is represented by this entry, or a null pointer if this entry is not based on an XTCETCContainer. It is recommended that users check the type of this entry using the provided methods prior to using the getters to retrieve underlying objects.- Returns:
- XTCETCContainer reference to the container represented by this entry or a null pointer.
- See Also:
getEntryType()
-
getHoldingContainer
public final XTCETMContainer getHoldingContainer()
Retrieve the XTCETMContainer that is represented by this entry, or a null pointer if this entry is not a XTCETMContainer within another XTCETMContainer. It is recommended that users check the type of this entry using the provided methods prior to using the getters to retrieve underlying objects.- Returns:
- XTCETMContainer reference to the container represented by this entry or a null pointer.
- See Also:
getEntryType()
-
getParameter
public final XTCEParameter getParameter()
Retrieve the XTCEParameter that is represented by this entry, or a null pointer if this entry is not based on an XTCEParameter. It is recommended that users check the type of this entry using the provided methods prior to using the getters to retrieve underlying objects.- Returns:
- XTCEParameter reference to the parameter represented by this entry or a null pointer.
- See Also:
getEntryType()
-
getArgument
public final XTCEArgument getArgument()
Retrieve the XTCEArgument that is represented by this entry, or a null pointer if this entry is not based on an XTCEArgument. It is recommended that users check the type of this entry using the provided methods prior to using the getters to retrieve underlying objects.- Returns:
- XTCEArgument reference to the argument represented by this entry or a null pointer.
- See Also:
getEntryType()
-
getTelecommand
public final XTCETelecommand getTelecommand()
Retrieve the XTCETelecommand that is represented by this entry, or a null pointer if this entry is not based on an XTCETelecommand. It is recommended that users check the type of this entry using the provided methods prior to using the getters to retrieve underlying objects.- Returns:
- XTCETelecommand reference to the telecommand represented by this entry or a null pointer.
- See Also:
getEntryType()
-
getEntryTypeString
public final String getEntryTypeString()
Retrieve the type of entry that this object represents in the overall container as a string.- Returns:
- String containing the text instead of the enumeration value.
-
getEntryType
public final XTCEContainerContentEntry.FieldType getEntryType()
Retrieve the type of entry that this object represents in the overall container as the native enumeration type.- Returns:
- FieldType containing the enumeration value.
-
getRawSizeInBits
public final String getRawSizeInBits()
Retrieve the size in bits that this entry occupies in the container stream, or an empty string if this entry is "information only", such as another container or a telecommand entry.- Returns:
- String containing the size in bits, or an empty string when it is not applicable to this entry.
-
getInitialValue
public final String getInitialValue()
Retrieve the initial/default value for this entry in the container stream, or an empty string if none is defined. Note that container and telecommand entries will never have a non-empty return value from this function.- Returns:
- String containing the initial/default value, or an empty string when does not exist for this entry.
-
getStartBit
public final String getStartBit()
Retrieve the start bit that this entry occupies in the container stream, or an empty string if this entry is "information only", such as another container or a telecommand entry.- Returns:
- String containing the start bit, or an empty string when it is not applicable to this entry or has not yet been set.
-
setStartBit
public final void setStartBit(long startBitValue)
Sets the start bit for this entry in the container stream.- Parameters:
startBitValue- long containing the start bit position.
-
setStartBit
public final void setStartBit(String startBitValue)
Sets the start bit for this entry in the container stream.- Parameters:
startBitValue- String containing the start bit position.
-
getValue
public final XTCEContainerEntryValue getValue()
Retrieves the value that is set or restricted on this entry based on ArgumentAssignment, RestrictionCriteria, or user chosen set values.- Returns:
- XTCEContainerEntryValue containing the value information for this entry or a null if there is none.
-
setValue
public final void setValue(ComparisonType compare)
Sets a value for this entry based on a RestrictionCriteria by passing the ComparisonType from the XTCE data model.- Parameters:
compare- ComparisonType element from the XTCE data model that contains the value, the operator, and the comparison flag.
-
setValue
public final void setValue(MetaCommandType.BaseMetaCommand.ArgumentAssignmentList.ArgumentAssignment argAssign)
Sets a value for this entry based on a ArgumentAssignment by passing the ArgumentAssignment from the XTCE data model.- Parameters:
argAssign- ArgumentAssignment element from the XTCE data model that contains the value, the operator, and the comparison flag.
-
setValue
public final void setValue(XTCEContainerEntryValue userValue)
Sets a value for this entry based on a XTCEContainerEntryValue from this toolkit.- Parameters:
userValue- XTCEContainerEntryValue object that is typically created when the user manually desires to set values on the container entries.
-
getConditions
public final String getConditions()
Retrieve a string representation of the list of include conditions that are applied to this entry in the container model.- Returns:
- String containing a comma separated list of the conditions in textual form, [PARAMETER][OPERATOR][VALUE}{form}, ... (e.g. PARAM1=4{uncal},PARAM2=HELLO{cal}).
-
getConditionList
public final List<XTCEContainerEntryValue> getConditionList()
Retrieve the list of include conditions that are applied to this entry in the container model.- Returns:
- List of XTCEContainerEntryValue conditions objects. The list will never be null, but is often empty.
-
setConditionList
public final void setConditionList(List<XTCEContainerEntryValue> allConditions, boolean entryInUse)
Sets the include condition list based on it already being evaluated. This is effectively setting all the conditions at once, which is useful for Members of an Aggregate or repeating entries where the list need not be evaluated again. The second argument is the "in use" flag. This is explained further.- Parameters:
allConditions- List of XTCEContainerEntryValue conditions to set the list.entryInUse- boolean indicating if this entry passes the include conditions and should be set to be in use.- See Also:
isCurrentlyInUse()
-
setCondition
public final void setCondition(XTCEParameter parameter, ComparisonType compare)
Sets the include condition for this entry, which is always based on a Parameter in a ComparisonType element from the XTCE data model.- Parameters:
parameter- XTCEParameter that is being compared in the condition.compare- ComparisonType element that contains the operator, value, and form of comparison.
-
getRepeatParameterInfo
public final String getRepeatParameterInfo()
Retrieve the repeating condition for this entry. The repeating condition is only set when it is not a fixed repeat count. When it is a fixed repeat count, this entry will just be repeated that number of times in the content model.- Returns:
- String containing the repeating entry condition, which will be in the form of [operator][parameter][form] (e.g. ==PARM1{cal}).
-
setRepeatparameterInfo
public final void setRepeatparameterInfo(String repeatString)
Sets the repeating condition for this entry. The repeating condition is only set when it is not a fixed repeat count. When it is a fixed repeat count, this entry will just be repeated that number of times in the content model.- Parameters:
repeatString- String containing the repeating entry condition, which must be in the form of [operator][parameter][form] (e.g. ==PARM1{cal}).
-
clone
protected Object clone() throws CloneNotSupportedException
Make a copy of this entry by copying all the references included. This function is useful for making high speed copies of this entry without performing all the initialization logic again. It is used when parameters/arguments/containers are repeating. Note that saying this is a "deep copy" is not actually the case.- Overrides:
clonein classObject- Returns:
- XTCEContainerContentEntry copy of this entry.
- Throws:
CloneNotSupportedException- in the event that this object cannot be cloned.
-
isCurrentlyInUse
public final boolean isCurrentlyInUse()
Retrieve the "in use" attribute of this entry. The "in use" attribute tells the caller if this entry is currently an active participant in the container. An entry is not in use when it has a conditional that is NOT satisfied.- Returns:
- boolean indicating if the entry is currently in use.
-
setCurrentlyInUse
public final void setCurrentlyInUse(boolean useFlag)
Sets the "in use" attribute of this entry. The "in use" attribute tells the caller if this entry is currently an active participant in the container. An entry is not in use when it has a conditional that is NOT satisfied.- Parameters:
useFlag- boolean indicating that this entry is currently used in the container definition for which it is included.
-
compareTo
public int compareTo(Object obj)
Comparison Operator This function is used for sorting XTCEContainerContentEntry by their start bit while safely ignoring those that do not have a start bit set.- Specified by:
compareToin interfaceComparable- Parameters:
obj- XTCEContainerContentEntry to compare to.- Returns:
- integer containing -1, 0, or 1 for less than, equal, or greater than, respectively.
- See Also:
Comparable
-
-