Package org.yamcs.xtce
Class AggregateDataType
- java.lang.Object
-
- org.yamcs.xtce.NameDescription
-
- org.yamcs.xtce.AggregateDataType
-
- All Implemented Interfaces:
Serializable,DataType
- Direct Known Subclasses:
AggregateArgumentType,AggregateParameterType
public class AggregateDataType extends NameDescription implements DataType
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAggregateDataType.Builder<T extends AggregateDataType.Builder<T>>
-
Field Summary
-
Fields inherited from class org.yamcs.xtce.NameDescription
ancillaryData, name, PATH_SEPARATOR, qualifiedName, xtceAliasSet
-
-
Constructor Summary
Constructors Modifier Constructor Description AggregateDataType(String name)protectedAggregateDataType(AggregateDataType t)AggregateDataType(AggregateDataType.Builder<?> builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>getInitialValue()Get the initial value if anyMembergetMember(int idx)MembergetMember(String name)Returns a member on the given name.MembergetMember(String[] path)Returns a member in a hierarchical aggregate.List<Member>getMemberList()AggregateMemberNamesgetMemberNames()StringgetTypeAsString()String which represents the type.Yamcs.Value.TypegetValueType()Return the expected Value type of an engineering value conforming to this XTCE data typeintnumMembers()Map<String,Object>parseString(String initialValue)Parse the initial value as a JSON string.StringtoString(Object v)Converts a value to a string.-
Methods inherited from class org.yamcs.xtce.NameDescription
addAlias, addAliases, addAncillaryData, getAlias, getAliasSet, getAncillaryData, getLongDescription, getName, getName, getOpsName, getQualifiedName, getShortDescription, getSubsystemName, getSubsystemName, setAliasSet, setAncillaryData, setLongDescription, setName, setQualifiedName, setShortDescription
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.yamcs.xtce.DataType
getLongDescription, getName, getShortDescription
-
-
-
-
Constructor Detail
-
AggregateDataType
public AggregateDataType(AggregateDataType.Builder<?> builder)
-
AggregateDataType
public AggregateDataType(String name)
-
AggregateDataType
protected AggregateDataType(AggregateDataType t)
-
-
Method Detail
-
getTypeAsString
public String getTypeAsString()
Description copied from interface:DataTypeString which represents the type. This string will be presented to the users of the system.- Specified by:
getTypeAsStringin interfaceDataType- Returns:
-
getMember
public Member getMember(String name)
Returns a member on the given name. If no such member is present return null- Parameters:
name- the name of the member to be returned- Returns:
- the member with the given name
-
getValueType
public Yamcs.Value.Type getValueType()
Description copied from interface:DataTypeReturn the expected Value type of an engineering value conforming to this XTCE data type- Specified by:
getValueTypein interfaceDataType- Returns:
-
getMember
public Member getMember(String[] path)
Returns a member in a hierarchical aggregate. It is equivalent with a chained call ofgetMember(String):getMember(path[0]).getMember(path[1])...getMember(path[n])
assuming that all the elements on the path exist.- Parameters:
path- - the path to be traversed. Its length has to be at least 1 - otherwise anIllegalArgumentExceptionwill be thrown.- Returns:
- the member obtained by traversing the path or null if not such member exist.
-
getMemberNames
public AggregateMemberNames getMemberNames()
- Returns:
- the (unique) object encoding the member names
-
numMembers
public int numMembers()
-
getMember
public Member getMember(int idx)
-
parseString
public Map<String,Object> parseString(String initialValue)
Parse the initial value as a JSON string.This allows to specify only partially the values, the rest are copied from the member initial value or the type definition (an exception is thrown if there is any member for which the value cannot be determined).
- Specified by:
parseStringin interfaceDataType- Parameters:
initialValue-- Returns:
- a map containing the values for all members.
- Throws:
IllegalArgumentException- if the string cannot be parsed or if values cannot be determined for all members
-
getInitialValue
public Map<String,Object> getInitialValue()
Description copied from interface:DataTypeGet the initial value if any- Specified by:
getInitialValuein interfaceDataType- Returns:
-
-