    001/*-
    002 * Copyright 2015, 2016 Diamond Light Source Ltd.
    003 *
    004 * All rights reserved. This program and the accompanying materials
    005 * are made available under the terms of the Eclipse Public License v1.0
    006 * which accompanies this distribution, and is available at
    007 * http://www.eclipse.org/legal/epl-v10.html
    008 */
    009
    010package org.eclipse.january.metadata;
    011
    012import java.util.List;
    013
    014public class DynamicMetadataUtils {
    015
    016        public static int[] refreshDynamicAxesMetadata(List<AxesMetadata> axm, int[] shape){
    017
    018                int[] maxShape = shape.clone();
    019                if (axm == null) return maxShape;
    020
    021                for (AxesMetadata a : axm) {
    022                        AxesMetadata ai = a;
    023                        int[] s = ai.refresh(shape);
    024                        for (int i = 0; i < s.length; i++) {
    025                                if (maxShape[i] > s[i]) maxShape[i] = s[i];
    026                        }
    027                }
    028
    029                return maxShape;
    030        }
    031
    032}