/** * Creates the acquisition information object if it does not already exists, then returns it. * * @return the acquisition information (never {@code null}). * @see #newAcquisition() */ private DefaultAcquisitionInformation acquisition() { if (acquisition == null) { acquisition = new DefaultAcquisitionInformation(); } return acquisition; }
/** * Creates the acquisition information object if it does not already exists, then returns it. * * @return the acquisition information (never {@code null}). * @see #newAcquisition() */ private DefaultAcquisitionInformation acquisition() { if (acquisition == null) { acquisition = new DefaultAcquisitionInformation(); } return acquisition; }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultAcquisitionInformation}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultAcquisitionInformation} instance is created using the * {@linkplain #DefaultAcquisitionInformation(AcquisitionInformation) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultAcquisitionInformation castOrCopy(final AcquisitionInformation object) { if (object == null || object instanceof DefaultAcquisitionInformation) { return (DefaultAcquisitionInformation) object; } return new DefaultAcquisitionInformation(object); }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultAcquisitionInformation}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultAcquisitionInformation} instance is created using the * {@linkplain #DefaultAcquisitionInformation(AcquisitionInformation) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultAcquisitionInformation castOrCopy(final AcquisitionInformation object) { if (object == null || object instanceof DefaultAcquisitionInformation) { return (DefaultAcquisitionInformation) object; } return new DefaultAcquisitionInformation(object); }
/** * Creates a metadata object having a cyclic association. The cycle is between * {@code platform.instrument} and {@code instrument.isMountedOn}. */ static DefaultAcquisitionInformation createCyclicMetadata() { final DefaultInstrument instrument = new DefaultInstrument(); instrument.setType(new SimpleInternationalString("An instrument type.")); final DefaultPlatform platform = new DefaultPlatform(); platform.setDescription(new SimpleInternationalString("A platform.")); instrument.setMountedOn(platform); platform.setInstruments(singleton(instrument)); final DefaultAcquisitionInformation acquisition = new DefaultAcquisitionInformation(); acquisition.setPlatforms(singleton(platform)); return acquisition; }