Class AqdefHierarchy


  • public class AqdefHierarchy
    extends Object
    Contains information about hierarchy of parts / characteristics / groups. There are two types of hiearchy definition within the AQDEF structure:
    • reagular hiearchy stored in K51xx keys
    • simplified characteristics hierarchy stored in K2030/K2031 keys
    Hierarchy model can be created only from one hierarchy type. Creating model from both types together is NOT supported.

    The simplified characteristics hierarchy

    The simplified characteristics hierarchy from K2030/K2031 keys is internally transformed to the K51xx structure. In other words, there is no way to get information about simple hierarchy back from the hierarchy model.

    Note that hierarchy model created from a simplified characteristics hierarchy needs to be normalized, because there could be characteristics without binding to a root part node, or there could be no root part node at all.

    Author:
    Vlastimil Dolejs, Honza Krakora
    See Also:
    normalize(AqdefObjectModel)
    • Constructor Detail

      • AqdefHierarchy

        public AqdefHierarchy()
    • Method Detail

      • removeHierarchyForPart

        public void removeHierarchyForPart​(PartIndex index)
        Removes node definition and all subnode definitions as well as node bindings for the provided part.
        Parameters:
        index - index of the part to remove hierarchy for
      • removeHierarchyForCharacteristic

        public void removeHierarchyForCharacteristic​(CharacteristicIndex index)
        Removes node definition and all subnode definitions as well as node bindings for the provided characteristic.
        Parameters:
        index - index of the characteristic to remove hierarchy for
      • removeHierarchyForGroup

        public void removeHierarchyForGroup​(GroupIndex index)
        Removes node definition and all subnode definitions as well as node bindings for the provided group.
        Parameters:
        index - index of the group to remove hierarchy for
      • normalize

        public AqdefHierarchy normalize​(AqdefObjectModel aqdefObjectModel)
        Get the normalized hierarchy.
        Parameters:
        aqdefObjectModel - an aqdef model containing this hierarchy, must not be null
        Returns:
        normalized hierarchy, the source hierarchy is not changed
      • isEmpty

        public boolean isEmpty()
      • getParentIndex

        public Optional<Object> getParentIndex​(CharacteristicIndex characteristicIndex)
        Find index of parent characteristic or group of given characteristic.
        Parameters:
        characteristicIndex -
        Returns:
        optional containing CharacteristicIndex or GroupIndex of parent, or empty optional if given characteristic do not have a parent
      • getParentIndex

        public Optional<Object> getParentIndex​(GroupIndex groupIndex)
        Find index of parent characteristic or group of given group.
        Parameters:
        groupIndex -
        Returns:
        optional containing CharacteristicIndex or GroupIndex of parent, or empty optional if given group do not have a parent