add() приватный Метод

private add ( Rectangle r ) : void
r Rectangle
Результат void
Пример #1
0
        /**
         * Find the the union of this rectangle and the passed rectangle.
         * Neither rectangle is altered
         *
         * @param r The rectangle to union with this rectangle
         */
        internal Rectangle union(Rectangle r)
        {
            Rectangle union = this.copy();

            union.add(r);
            return(union);
        }
Пример #2
0
        /**
         * Given a Node<T> object, calculate the Node<T> MBR from it's entries.
         * Used in consistency checking
         */
        private Rectangle calculateMBR(Node <T> n)
        {
            Rectangle mbr = new Rectangle(n.entries[0].min, n.entries[0].max);

            for (int i = 1; i < n.entryCount; i++)
            {
                mbr.add(n.entries[i]);
            }
            return(mbr);
        }