/** * Returns the list of all available systems of units. * * @return list of available systems of units. */ @Override public Collection<SystemOfUnits> getAvailableSystemsOfUnits() { return UnmodifiableArrayList.<SystemOfUnits>wrap(systems); }
/** * Returns an unmodifiable view over the elements cached so far. * The returned list does not contain any elements that were not yet fetched from the source. * * @return the elements cached so far. */ protected final List<E> cached() { return UnmodifiableArrayList.wrap(cachedElements, 0, numCached); }
/** * Returns information about the <cite>range</cite> of this grid coverage. * Information include names, sample value ranges, fill values and transfer functions for all bands in this grid coverage. * * @return names, value ranges, fill values and transfer functions for all bands in this grid coverage. */ public List<SampleDimension> getSampleDimensions() { return UnmodifiableArrayList.wrap(sampleDimensions); }
/** * Returns all tables in declaration order. * The list contains only the tables explicitly requested at construction time. * * @return all tables in an unmodifiable list. */ public final List<Resource> tables() { return UnmodifiableArrayList.wrap(tables); }
/** * Returns an unmodifiable view over the elements cached so far. * The returned list does not contain any elements that were not yet fetched from the source. * * @return the elements cached so far. */ protected final List<E> cached() { return UnmodifiableArrayList.wrap(cachedElements, 0, numCached); }
/** * Returns the given collection as an unmodifiable list. */ @SuppressWarnings("unchecked") private static List<InternationalString> snapshot(final Collection<? extends InternationalString> c) { if (c instanceof UnmodifiableArrayList<?>) { return (List<InternationalString>) c; // Unsafe cast okay because we allow only read operations. } else { return UnmodifiableArrayList.wrap(c.toArray(new InternationalString[c.size()])); } }
/** * Invoked by JAXB only at unmarshalling time. */ private void setAccuracy(final PositionalAccuracy[] values) { if (coordinateOperationAccuracy == null) { coordinateOperationAccuracy = UnmodifiableArrayList.wrap(values); } else { MetadataUtilities.propertyAlreadySet(AbstractCoordinateOperation.class, "setAccuracy", "coordinateOperationAccuracy"); } }
/** * Returns the names of all attributes in the given list. */ static List<String> toNames(final List<Attribute> attributes) { final String[] names = new String[attributes.size()]; for (int i=0; i<names.length; i++) { names[i] = attributes.get(i).getShortName(); } return UnmodifiableArrayList.wrap(names); }
/** * Returns the names of all attributes in the given list. */ static List<String> toNames(final List<Attribute> attributes) { final String[] names = new String[attributes.size()]; for (int i=0; i<names.length; i++) { names[i] = attributes.get(i).getShortName(); } return UnmodifiableArrayList.wrap(names); }
/** * Returns the given array of parameters as an unmodifiable list. */ private static List<GeneralParameterDescriptor> asList(final GeneralParameterDescriptor[] parameters) { switch (parameters.length) { case 0: return Collections.emptyList(); case 1: return Collections.singletonList(parameters[0]); case 2: // fall through case 3: return UnmodifiableArrayList.wrap(parameters); default: return new AsList(parameters); } }
/** * Invoked by JAXB only at unmarshalling time. */ private void setAccuracy(final PositionalAccuracy[] values) { if (coordinateOperationAccuracy == null) { coordinateOperationAccuracy = UnmodifiableArrayList.wrap(values); } else { MetadataUtilities.propertyAlreadySet(AbstractCoordinateOperation.class, "setAccuracy", "coordinateOperationAccuracy"); } }
/** * Computes the {@link #components} and {@link #singles} fields from the given CRS list. * If the two lists have the same content, then the two fields will reference the same list. * * @see #getComponents() */ private void setComponents(final List<? extends CoordinateReferenceSystem> crs) { if (setSingleComponents(crs)) { components = singles; // Shares the same list. } else { components = UnmodifiableArrayList.wrap(crs.toArray(new CoordinateReferenceSystem[crs.size()])); } }
/** * Computes the {@link #components} and {@link #singles} fields from the given CRS list. * If the two lists have the same content, then the two fields will reference the same list. * * @see #getComponents() */ private void setComponents(final List<? extends CoordinateReferenceSystem> crs) { if (setSingleComponents(crs)) { components = singles; // Shares the same list. } else { components = UnmodifiableArrayList.wrap(crs.toArray(new CoordinateReferenceSystem[crs.size()])); } }
/** * Returns the given array of parameters as an unmodifiable list. */ private static List<GeneralParameterDescriptor> asList(final GeneralParameterDescriptor[] parameters) { switch (parameters.length) { case 0: return Collections.emptyList(); case 1: return Collections.singletonList(parameters[0]); case 2: // fall through case 3: return UnmodifiableArrayList.wrap(parameters); default: return new AsList(parameters); } }
/** * This is a work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). * * @param components the coordinate systems. */ @Workaround(library="JDK", version="1.7") private DefaultCompoundCS(final CoordinateSystem[] components, final CoordinateSystemAxis[] axes) { super(singletonMap(NAME_KEY, AxisDirections.appendTo(new StringBuilder(60).append("Compound CS"), axes)), axes); this.components = UnmodifiableArrayList.wrap(components); }
/** * This is a work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). * * @param components the coordinate systems. */ @Workaround(library="JDK", version="1.7") private DefaultCompoundCS(final CoordinateSystem[] components, final CoordinateSystemAxis[] axes) { super(singletonMap(NAME_KEY, AxisDirections.appendTo(new StringBuilder(60).append("Compound CS"), axes)), axes); this.components = UnmodifiableArrayList.wrap(components); }
/** * Returns the parameters descriptors in this group. The amount of parameters depends * on the value of {@code "num_row"} and {@code "num_col"} parameters. */ @Override public List<GeneralParameterDescriptor> descriptors() { return UnmodifiableArrayList.<GeneralParameterDescriptor>wrap(descriptors.getAllDescriptors(size())); }
/** * Returns the parameters descriptors in this group. The amount of parameters depends * on the value of {@code "num_row"} and {@code "num_col"} parameters. */ @Override public List<GeneralParameterDescriptor> descriptors() { return UnmodifiableArrayList.wrap(descriptors.getAllDescriptors(size())); }
/** * Invoked by JAXB for setting the components of this compound CRS. */ private void setXMLComponents(final CoordinateReferenceSystem[] crs) { components = setSingleComponents(Arrays.asList(crs)) ? singles : UnmodifiableArrayList.wrap(crs); setCoordinateSystem("coordinateSystem", createCoordinateSystem(null, crs)); } }
/** * Invoked by JAXB for setting the components of this compound CRS. */ private void setXMLComponents(final CoordinateReferenceSystem[] crs) { components = setSingleComponents(Arrays.asList(crs)) ? singles : UnmodifiableArrayList.wrap(crs); setCoordinateSystem("coordinateSystem", createCoordinateSystem(null, crs)); } }