private int componentSizeOctetsInitialize() { return SMFAttributeType.super.componentSizeOctets(); }
private int sizeOctetsInitialize() { return SMFAttributeType.super.sizeOctets(); }
/** * Fill a builder with attribute values from the provided {@code SMFAttributeType} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(SMFAttributeType instance) { Objects.requireNonNull(instance, "instance"); setName(instance.name()); setComponentType(instance.componentType()); setComponentCount(instance.componentCount()); setComponentSizeBits(instance.componentSizeBits()); return this; }
default void checkPreconditions() if (Integer.compareUnsigned(this.componentCount(), 1) < 0) { throw new IllegalArgumentException( "Component count must be in the range [1, 4]"); if (Integer.compareUnsigned(this.componentCount(), 4) > 0) { throw new IllegalArgumentException( "Component count must be in the range [1, 4]"); switch (this.componentType()) { case ELEMENT_TYPE_INTEGER_SIGNED: { SMFSupportedSizes.checkIntegerSignedSupported(this.componentSizeBits()); break; SMFSupportedSizes.checkIntegerUnsignedSupported(this.componentSizeBits()); break; SMFSupportedSizes.checkFloatSupported(this.componentSizeBits()); break;
private static IllegalArgumentException incompatibleType( final SMFAttributeNameType name, final SMFArrayAttributeMappingType required_attribute, final SMFAttributeType received_attribute) { final StringBuilder sb = new StringBuilder(128); sb.append("Incompatible types."); sb.append(System.lineSeparator()); sb.append(" Attribute: "); sb.append(name.value()); sb.append(System.lineSeparator()); sb.append(" Required type: "); sb.append(required_attribute.componentCount()); sb.append(" of "); sb.append(required_attribute.componentType().get()); sb.append(System.lineSeparator()); sb.append(" Received type: "); sb.append(received_attribute.componentCount()); sb.append(" of "); sb.append(received_attribute.componentType()); sb.append(System.lineSeparator()); return new IllegalArgumentException(sb.toString()); }
/** * @return The size of the attribute in octets */ @Value.Derived default int sizeOctets() { return Math.multiplyExact( this.componentSizeOctets(), this.componentCount()); }
/** * @return The size of a single component in octets */ @Value.Derived default int componentSizeOctets() { return (int) Math.ceil((double) this.componentSizeBits() / 8.0); }
/** * Fill a builder with attribute values from the provided {@code SMFAttributeType} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(SMFAttributeType instance) { Objects.requireNonNull(instance, "instance"); setName(instance.name()); setComponentType(instance.componentType()); setComponentCount(instance.componentCount()); setComponentSizeBits(instance.componentSizeBits()); return this; }
default void checkPreconditions() if (Integer.compareUnsigned(this.componentCount(), 1) < 0) { throw new IllegalArgumentException( "Component count must be in the range [1, 4]"); if (Integer.compareUnsigned(this.componentCount(), 4) > 0) { throw new IllegalArgumentException( "Component count must be in the range [1, 4]"); switch (this.componentType()) { case ELEMENT_TYPE_INTEGER_SIGNED: { SMFSupportedSizes.checkIntegerSignedSupported(this.componentSizeBits()); break; SMFSupportedSizes.checkIntegerUnsignedSupported(this.componentSizeBits()); break; SMFSupportedSizes.checkFloatSupported(this.componentSizeBits()); break;
final Seq<String> line) switch (attribute.componentType()) { case ELEMENT_TYPE_INTEGER_SIGNED: { switch (attribute.componentCount()) { case 1: { this.parseAttributeElementSigned1(line); switch (attribute.componentCount()) { case 1: { this.parseAttributeElementUnsigned1(line); switch (attribute.componentCount()) { case 1: { this.parseAttributeElementFloat1(line);
/** * @return The size of the attribute in octets */ @Value.Derived default int sizeOctets() { return Math.multiplyExact( this.componentSizeOctets(), this.componentCount()); }
/** * @return The size of a single component in octets */ @Value.Derived default int componentSizeOctets() { return (int) Math.ceil((double) this.componentSizeBits() / 8.0); }
private int sizeOctetsInitialize() { return SMFAttributeType.super.sizeOctets(); }
private int componentSizeOctetsInitialize() { return SMFAttributeType.super.componentSizeOctets(); }