Class ShapeHierarchy


  • public class ShapeHierarchy
    extends java.lang.Object
    The shape hierarchy class parses the hierarchy info file and generate two map objects (child to parent and parent to child relationship). The hierarchy info is cached as well.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  ShapeHierarchy.HierarchyStructure
      A inner class used to store the child:parent relationship objects
    • Constructor Summary

      Constructors 
      Constructor Description
      ShapeHierarchy​(java.lang.String pathFolder)
      Class Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> getChildParentKeys()
      Get all the shape Ids inside the hierarchy structure.
      java.util.List<java.lang.String> getChildParentPairForType​(java.lang.String type)
      Get all the childShapeId:parentShapeId values for a given childShapeType:parentShapeType key.
      java.util.Set<java.lang.String> getChildren​(java.lang.String parentId, java.lang.String type)
      Get all the children of a shapeId with a specific shapeType
      java.util.Set<java.lang.String> getParents​(java.lang.String childId, java.lang.String type)
      Get all the parents of a shapeId with a specific shapeType
      protected static ShapeHierarchy.HierarchyStructure parseShapeHierachy​(java.lang.String filePath)
      Read the shape hierarchy files from given path and build a ShapeHierarchy.HierarchyStructure object and caches it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShapeHierarchy

        public ShapeHierarchy​(java.lang.String pathFolder)
        Class Constructor
        Parameters:
        pathFolder - The folder path to the hierarchy files
    • Method Detail

      • getParents

        public java.util.Set<java.lang.String> getParents​(java.lang.String childId,
                                                          java.lang.String type)
        Get all the parents of a shapeId with a specific shapeType
        Parameters:
        childId - The shape id
        type - The shape type
        Returns:
        A set of all the shape parent type@id objects.
      • getChildren

        public java.util.Set<java.lang.String> getChildren​(java.lang.String parentId,
                                                           java.lang.String type)
        Get all the children of a shapeId with a specific shapeType
        Parameters:
        childId - The shape id
        type - The shape type
        Returns:
        A set of all the child shape type@id objects.
      • getChildParentPairForType

        public java.util.List<java.lang.String> getChildParentPairForType​(java.lang.String type)
        Get all the childShapeId:parentShapeId values for a given childShapeType:parentShapeType key.
        Parameters:
        type - The key in the childShapeType:parentShapeType format.
        Returns:
        A list of all childShapeId:parentShapeId objects for the given key.
      • getChildParentKeys

        public java.util.Set<java.lang.String> getChildParentKeys()
        Get all the shape Ids inside the hierarchy structure.
        Returns:
        A set object with unique keys representing the shapeIds.