Package org.mp4parser

Class BasicContainer

    • Constructor Detail

      • BasicContainer

        public BasicContainer()
      • BasicContainer

        public BasicContainer​(List<Box> boxes)
    • Method Detail

      • getBoxes

        public List<Box> getBoxes()
        Description copied from interface: Container
        Gets all child boxes. May not return null.
        Specified by:
        getBoxes in interface Container
        Returns:
        an array of boxes, empty array in case of no children.
      • setBoxes

        public void setBoxes​(List<? extends Box> boxes)
        Description copied from interface: Container
        Sets all boxes and removes all previous child boxes.
        Specified by:
        setBoxes in interface Container
        Parameters:
        boxes - the new list of children
      • getContainerSize

        protected long getContainerSize()
      • getBoxes

        public <T extends BoxList<T> getBoxes​(Class<T> clazz)
        Description copied from interface: Container
        Gets all child boxes of the given type. May not return null.
        Specified by:
        getBoxes in interface Container
        Type Parameters:
        T - type of boxes to get
        Parameters:
        clazz - child box's type
        Returns:
        an array of boxes, empty array in case of no children.
      • getBoxes

        public <T extends BoxList<T> getBoxes​(Class<T> clazz,
                                                boolean recursive)
        Description copied from interface: Container
        Gets all child boxes of the given type. May not return null.
        Specified by:
        getBoxes in interface Container
        Type Parameters:
        T - type of boxes to get
        Parameters:
        clazz - child box's type
        recursive - step down the tree
        Returns:
        an array of boxes, empty array in case of no children.
      • addBox

        public void addBox​(Box box)
        Add box to the container and sets the parent correctly. If box is null nochange will be performed and no error thrown.
        Parameters:
        box - will be added to the container