diff --git a/build.gradle.kts b/build.gradle.kts index c3e44b3..8c61ae9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,11 +3,15 @@ plugins { } allprojects { + repositories{ + mavenLocal() + } + group = "ru.inr.mass" version = "0.1.0" } -val dataforgeVersion by extra("0.3.0-dev-1") +val dataforgeVersion by extra("0.3.0-dev-2") apiValidation{ validationDisabled = true diff --git a/numass-data-model/src/main/kotlin/ru/inr/mass/data/api/NumassSet.kt b/numass-data-model/src/main/kotlin/ru/inr/mass/data/api/NumassSet.kt index 03e7721..4521433 100644 --- a/numass-data-model/src/main/kotlin/ru/inr/mass/data/api/NumassSet.kt +++ b/numass-data-model/src/main/kotlin/ru/inr/mass/data/api/NumassSet.kt @@ -40,20 +40,19 @@ public interface NumassSet : Iterable, Provider { return points.iterator() } - - override val defaultTarget: String get() = NUMASS_POINT_PROVIDER_KEY + override val defaultTarget: String get() = NUMASS_POINT_TARGET override fun content(target: String): Map { - return if (target == NUMASS_POINT_PROVIDER_KEY) { + return if (target == NUMASS_POINT_TARGET) { points.associateBy { "point[${it.voltage}]".toName() } } else { super.content(target) } } - companion object { - const val DESCRIPTION_KEY = "info" - const val NUMASS_POINT_PROVIDER_KEY = "point" + public companion object { + //public const val DESCRIPTION_KEY = "info" + public const val NUMASS_POINT_TARGET: String = "point" } } diff --git a/numass-data-proto/gen/main/java/ru/inr/mass/data/proto/NumassProto.java b/numass-data-proto/gen/main/java/ru/inr/mass/data/proto/NumassProto.java deleted file mode 100644 index 70958d3..0000000 --- a/numass-data-proto/gen/main/java/ru/inr/mass/data/proto/NumassProto.java +++ /dev/null @@ -1,4995 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: ru/inr/mass/data/proto/numass-proto.proto - -package ru.inr.mass.data.proto; - -public final class NumassProto { - private NumassProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - public interface PointOrBuilder extends - // @@protoc_insertion_point(interface_extends:ru.inr.mass.data.proto.Point) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - java.util.List - getChannelsList(); - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - ru.inr.mass.data.proto.NumassProto.Point.Channel getChannels(int index); - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - int getChannelsCount(); - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - java.util.List - getChannelsOrBuilderList(); - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - ru.inr.mass.data.proto.NumassProto.Point.ChannelOrBuilder getChannelsOrBuilder( - int index); - } - /** - * Protobuf type {@code ru.inr.mass.data.proto.Point} - */ - public static final class Point extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:ru.inr.mass.data.proto.Point) - PointOrBuilder { - private static final long serialVersionUID = 0L; - // Use Point.newBuilder() to construct. - private Point(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Point() { - channels_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Point(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Point( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - channels_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - channels_.add( - input.readMessage(ru.inr.mass.data.proto.NumassProto.Point.Channel.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - channels_ = java.util.Collections.unmodifiableList(channels_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.class, ru.inr.mass.data.proto.NumassProto.Point.Builder.class); - } - - public interface ChannelOrBuilder extends - // @@protoc_insertion_point(interface_extends:ru.inr.mass.data.proto.Point.Channel) - com.google.protobuf.MessageOrBuilder { - - /** - *
-       * The number of measuring channel
-       * 
- * - * uint64 id = 1; - * @return The id. - */ - long getId(); - - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - java.util.List - getBlocksList(); - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block getBlocks(int index); - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - int getBlocksCount(); - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - java.util.List - getBlocksOrBuilderList(); - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - ru.inr.mass.data.proto.NumassProto.Point.Channel.BlockOrBuilder getBlocksOrBuilder( - int index); - } - /** - *
-     * A single channel for multichannel detector readout
-     * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel} - */ - public static final class Channel extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:ru.inr.mass.data.proto.Point.Channel) - ChannelOrBuilder { - private static final long serialVersionUID = 0L; - // Use Channel.newBuilder() to construct. - private Channel(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Channel() { - blocks_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Channel(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Channel( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - id_ = input.readUInt64(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - blocks_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - blocks_.add( - input.readMessage(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - blocks_ = java.util.Collections.unmodifiableList(blocks_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder.class); - } - - public interface BlockOrBuilder extends - // @@protoc_insertion_point(interface_extends:ru.inr.mass.data.proto.Point.Channel.Block) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * Block start in epoch nanos
-         * 
- * - * uint64 time = 1; - * @return The time. - */ - long getTime(); - - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - java.util.List - getFramesList(); - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame getFrames(int index); - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - int getFramesCount(); - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - java.util.List - getFramesOrBuilderList(); - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.FrameOrBuilder getFramesOrBuilder( - int index); - - /** - *
-         * Events array
-         * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - * @return Whether the events field is set. - */ - boolean hasEvents(); - /** - *
-         * Events array
-         * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - * @return The events. - */ - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events getEvents(); - /** - *
-         * Events array
-         * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.EventsOrBuilder getEventsOrBuilder(); - - /** - *
-         * block size in nanos. If missing, take from meta.
-         * 
- * - * uint64 length = 4; - * @return The length. - */ - long getLength(); - - /** - *
-         * tick size in nanos. Obsolete, to be removed
-         * 
- * - * uint64 bin_size = 5; - * @return The binSize. - */ - long getBinSize(); - } - /** - *
-       *A continuous measurement block
-       * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel.Block} - */ - public static final class Block extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:ru.inr.mass.data.proto.Point.Channel.Block) - BlockOrBuilder { - private static final long serialVersionUID = 0L; - // Use Block.newBuilder() to construct. - private Block(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Block() { - frames_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Block(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Block( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - time_ = input.readUInt64(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - frames_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - frames_.add( - input.readMessage(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.parser(), extensionRegistry)); - break; - } - case 26: { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder subBuilder = null; - if (events_ != null) { - subBuilder = events_.toBuilder(); - } - events_ = input.readMessage(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(events_); - events_ = subBuilder.buildPartial(); - } - - break; - } - case 32: { - - length_ = input.readUInt64(); - break; - } - case 40: { - - binSize_ = input.readUInt64(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - frames_ = java.util.Collections.unmodifiableList(frames_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder.class); - } - - public interface FrameOrBuilder extends - // @@protoc_insertion_point(interface_extends:ru.inr.mass.data.proto.Point.Channel.Block.Frame) - com.google.protobuf.MessageOrBuilder { - - /** - *
-           * Time in nanos from the beginning of the block
-           * 
- * - * uint64 time = 1; - * @return The time. - */ - long getTime(); - - /** - *
-           * Frame data as an array of int16 mesured in arbitrary channels
-           * 
- * - * bytes data = 2; - * @return The data. - */ - com.google.protobuf.ByteString getData(); - } - /** - *
-         * Raw data frame
-         * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel.Block.Frame} - */ - public static final class Frame extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:ru.inr.mass.data.proto.Point.Channel.Block.Frame) - FrameOrBuilder { - private static final long serialVersionUID = 0L; - // Use Frame.newBuilder() to construct. - private Frame(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Frame() { - data_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Frame(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Frame( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - time_ = input.readUInt64(); - break; - } - case 18: { - - data_ = input.readBytes(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder.class); - } - - public static final int TIME_FIELD_NUMBER = 1; - private long time_; - /** - *
-           * Time in nanos from the beginning of the block
-           * 
- * - * uint64 time = 1; - * @return The time. - */ - @java.lang.Override - public long getTime() { - return time_; - } - - public static final int DATA_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString data_; - /** - *
-           * Frame data as an array of int16 mesured in arbitrary channels
-           * 
- * - * bytes data = 2; - * @return The data. - */ - @java.lang.Override - public com.google.protobuf.ByteString getData() { - return data_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (time_ != 0L) { - output.writeUInt64(1, time_); - } - if (!data_.isEmpty()) { - output.writeBytes(2, data_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (time_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, time_); - } - if (!data_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, data_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame)) { - return super.equals(obj); - } - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame other = (ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame) obj; - - if (getTime() - != other.getTime()) return false; - if (!getData() - .equals(other.getData())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTime()); - hash = (37 * hash) + DATA_FIELD_NUMBER; - hash = (53 * hash) + getData().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-           * Raw data frame
-           * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel.Block.Frame} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:ru.inr.mass.data.proto.Point.Channel.Block.Frame) - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.FrameOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder.class); - } - - // Construct using ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - time_ = 0L; - - data_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_descriptor; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame getDefaultInstanceForType() { - return ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.getDefaultInstance(); - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame build() { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame buildPartial() { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame result = new ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame(this); - result.time_ = time_; - result.data_ = data_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame) { - return mergeFrom((ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame other) { - if (other == ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.getDefaultInstance()) return this; - if (other.getTime() != 0L) { - setTime(other.getTime()); - } - if (other.getData() != com.google.protobuf.ByteString.EMPTY) { - setData(other.getData()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long time_ ; - /** - *
-             * Time in nanos from the beginning of the block
-             * 
- * - * uint64 time = 1; - * @return The time. - */ - @java.lang.Override - public long getTime() { - return time_; - } - /** - *
-             * Time in nanos from the beginning of the block
-             * 
- * - * uint64 time = 1; - * @param value The time to set. - * @return This builder for chaining. - */ - public Builder setTime(long value) { - - time_ = value; - onChanged(); - return this; - } - /** - *
-             * Time in nanos from the beginning of the block
-             * 
- * - * uint64 time = 1; - * @return This builder for chaining. - */ - public Builder clearTime() { - - time_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; - /** - *
-             * Frame data as an array of int16 mesured in arbitrary channels
-             * 
- * - * bytes data = 2; - * @return The data. - */ - @java.lang.Override - public com.google.protobuf.ByteString getData() { - return data_; - } - /** - *
-             * Frame data as an array of int16 mesured in arbitrary channels
-             * 
- * - * bytes data = 2; - * @param value The data to set. - * @return This builder for chaining. - */ - public Builder setData(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - data_ = value; - onChanged(); - return this; - } - /** - *
-             * Frame data as an array of int16 mesured in arbitrary channels
-             * 
- * - * bytes data = 2; - * @return This builder for chaining. - */ - public Builder clearData() { - - data_ = getDefaultInstance().getData(); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:ru.inr.mass.data.proto.Point.Channel.Block.Frame) - } - - // @@protoc_insertion_point(class_scope:ru.inr.mass.data.proto.Point.Channel.Block.Frame) - private static final ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame(); - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Frame parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Frame(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface EventsOrBuilder extends - // @@protoc_insertion_point(interface_extends:ru.inr.mass.data.proto.Point.Channel.Block.Events) - com.google.protobuf.MessageOrBuilder { - - /** - *
-           * Array of time in nanos from the beginning of the block
-           * 
- * - * repeated uint64 times = 1; - * @return A list containing the times. - */ - java.util.List getTimesList(); - /** - *
-           * Array of time in nanos from the beginning of the block
-           * 
- * - * repeated uint64 times = 1; - * @return The count of times. - */ - int getTimesCount(); - /** - *
-           * Array of time in nanos from the beginning of the block
-           * 
- * - * repeated uint64 times = 1; - * @param index The index of the element to return. - * @return The times at the given index. - */ - long getTimes(int index); - - /** - *
-           * Array of amplitudes of events in channels
-           * 
- * - * repeated uint64 amplitudes = 2; - * @return A list containing the amplitudes. - */ - java.util.List getAmplitudesList(); - /** - *
-           * Array of amplitudes of events in channels
-           * 
- * - * repeated uint64 amplitudes = 2; - * @return The count of amplitudes. - */ - int getAmplitudesCount(); - /** - *
-           * Array of amplitudes of events in channels
-           * 
- * - * repeated uint64 amplitudes = 2; - * @param index The index of the element to return. - * @return The amplitudes at the given index. - */ - long getAmplitudes(int index); - } - /** - *
-         * Event block obtained directly from  device of from frame analysis
-         * In order to save space, times and amplitudes are in separate arrays.
-         * Amplitude and time with the same index correspond to the same event
-         * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel.Block.Events} - */ - public static final class Events extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:ru.inr.mass.data.proto.Point.Channel.Block.Events) - EventsOrBuilder { - private static final long serialVersionUID = 0L; - // Use Events.newBuilder() to construct. - private Events(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Events() { - times_ = emptyLongList(); - amplitudes_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Events(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Events( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - times_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - times_.addLong(input.readUInt64()); - break; - } - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - times_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - times_.addLong(input.readUInt64()); - } - input.popLimit(limit); - break; - } - case 16: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - amplitudes_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - amplitudes_.addLong(input.readUInt64()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - amplitudes_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - amplitudes_.addLong(input.readUInt64()); - } - input.popLimit(limit); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - times_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - amplitudes_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder.class); - } - - public static final int TIMES_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.LongList times_; - /** - *
-           * Array of time in nanos from the beginning of the block
-           * 
- * - * repeated uint64 times = 1; - * @return A list containing the times. - */ - @java.lang.Override - public java.util.List - getTimesList() { - return times_; - } - /** - *
-           * Array of time in nanos from the beginning of the block
-           * 
- * - * repeated uint64 times = 1; - * @return The count of times. - */ - public int getTimesCount() { - return times_.size(); - } - /** - *
-           * Array of time in nanos from the beginning of the block
-           * 
- * - * repeated uint64 times = 1; - * @param index The index of the element to return. - * @return The times at the given index. - */ - public long getTimes(int index) { - return times_.getLong(index); - } - private int timesMemoizedSerializedSize = -1; - - public static final int AMPLITUDES_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.LongList amplitudes_; - /** - *
-           * Array of amplitudes of events in channels
-           * 
- * - * repeated uint64 amplitudes = 2; - * @return A list containing the amplitudes. - */ - @java.lang.Override - public java.util.List - getAmplitudesList() { - return amplitudes_; - } - /** - *
-           * Array of amplitudes of events in channels
-           * 
- * - * repeated uint64 amplitudes = 2; - * @return The count of amplitudes. - */ - public int getAmplitudesCount() { - return amplitudes_.size(); - } - /** - *
-           * Array of amplitudes of events in channels
-           * 
- * - * repeated uint64 amplitudes = 2; - * @param index The index of the element to return. - * @return The amplitudes at the given index. - */ - public long getAmplitudes(int index) { - return amplitudes_.getLong(index); - } - private int amplitudesMemoizedSerializedSize = -1; - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (getTimesList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(timesMemoizedSerializedSize); - } - for (int i = 0; i < times_.size(); i++) { - output.writeUInt64NoTag(times_.getLong(i)); - } - if (getAmplitudesList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(amplitudesMemoizedSerializedSize); - } - for (int i = 0; i < amplitudes_.size(); i++) { - output.writeUInt64NoTag(amplitudes_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < times_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt64SizeNoTag(times_.getLong(i)); - } - size += dataSize; - if (!getTimesList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - timesMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < amplitudes_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt64SizeNoTag(amplitudes_.getLong(i)); - } - size += dataSize; - if (!getAmplitudesList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - amplitudesMemoizedSerializedSize = dataSize; - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events)) { - return super.equals(obj); - } - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events other = (ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events) obj; - - if (!getTimesList() - .equals(other.getTimesList())) return false; - if (!getAmplitudesList() - .equals(other.getAmplitudesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getTimesCount() > 0) { - hash = (37 * hash) + TIMES_FIELD_NUMBER; - hash = (53 * hash) + getTimesList().hashCode(); - } - if (getAmplitudesCount() > 0) { - hash = (37 * hash) + AMPLITUDES_FIELD_NUMBER; - hash = (53 * hash) + getAmplitudesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-           * Event block obtained directly from  device of from frame analysis
-           * In order to save space, times and amplitudes are in separate arrays.
-           * Amplitude and time with the same index correspond to the same event
-           * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel.Block.Events} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:ru.inr.mass.data.proto.Point.Channel.Block.Events) - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.EventsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder.class); - } - - // Construct using ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - times_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - amplitudes_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_descriptor; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events getDefaultInstanceForType() { - return ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.getDefaultInstance(); - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events build() { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events buildPartial() { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events result = new ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - times_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.times_ = times_; - if (((bitField0_ & 0x00000002) != 0)) { - amplitudes_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.amplitudes_ = amplitudes_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events) { - return mergeFrom((ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events other) { - if (other == ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.getDefaultInstance()) return this; - if (!other.times_.isEmpty()) { - if (times_.isEmpty()) { - times_ = other.times_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTimesIsMutable(); - times_.addAll(other.times_); - } - onChanged(); - } - if (!other.amplitudes_.isEmpty()) { - if (amplitudes_.isEmpty()) { - amplitudes_ = other.amplitudes_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureAmplitudesIsMutable(); - amplitudes_.addAll(other.amplitudes_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.LongList times_ = emptyLongList(); - private void ensureTimesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - times_ = mutableCopy(times_); - bitField0_ |= 0x00000001; - } - } - /** - *
-             * Array of time in nanos from the beginning of the block
-             * 
- * - * repeated uint64 times = 1; - * @return A list containing the times. - */ - public java.util.List - getTimesList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(times_) : times_; - } - /** - *
-             * Array of time in nanos from the beginning of the block
-             * 
- * - * repeated uint64 times = 1; - * @return The count of times. - */ - public int getTimesCount() { - return times_.size(); - } - /** - *
-             * Array of time in nanos from the beginning of the block
-             * 
- * - * repeated uint64 times = 1; - * @param index The index of the element to return. - * @return The times at the given index. - */ - public long getTimes(int index) { - return times_.getLong(index); - } - /** - *
-             * Array of time in nanos from the beginning of the block
-             * 
- * - * repeated uint64 times = 1; - * @param index The index to set the value at. - * @param value The times to set. - * @return This builder for chaining. - */ - public Builder setTimes( - int index, long value) { - ensureTimesIsMutable(); - times_.setLong(index, value); - onChanged(); - return this; - } - /** - *
-             * Array of time in nanos from the beginning of the block
-             * 
- * - * repeated uint64 times = 1; - * @param value The times to add. - * @return This builder for chaining. - */ - public Builder addTimes(long value) { - ensureTimesIsMutable(); - times_.addLong(value); - onChanged(); - return this; - } - /** - *
-             * Array of time in nanos from the beginning of the block
-             * 
- * - * repeated uint64 times = 1; - * @param values The times to add. - * @return This builder for chaining. - */ - public Builder addAllTimes( - java.lang.Iterable values) { - ensureTimesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, times_); - onChanged(); - return this; - } - /** - *
-             * Array of time in nanos from the beginning of the block
-             * 
- * - * repeated uint64 times = 1; - * @return This builder for chaining. - */ - public Builder clearTimes() { - times_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList amplitudes_ = emptyLongList(); - private void ensureAmplitudesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - amplitudes_ = mutableCopy(amplitudes_); - bitField0_ |= 0x00000002; - } - } - /** - *
-             * Array of amplitudes of events in channels
-             * 
- * - * repeated uint64 amplitudes = 2; - * @return A list containing the amplitudes. - */ - public java.util.List - getAmplitudesList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(amplitudes_) : amplitudes_; - } - /** - *
-             * Array of amplitudes of events in channels
-             * 
- * - * repeated uint64 amplitudes = 2; - * @return The count of amplitudes. - */ - public int getAmplitudesCount() { - return amplitudes_.size(); - } - /** - *
-             * Array of amplitudes of events in channels
-             * 
- * - * repeated uint64 amplitudes = 2; - * @param index The index of the element to return. - * @return The amplitudes at the given index. - */ - public long getAmplitudes(int index) { - return amplitudes_.getLong(index); - } - /** - *
-             * Array of amplitudes of events in channels
-             * 
- * - * repeated uint64 amplitudes = 2; - * @param index The index to set the value at. - * @param value The amplitudes to set. - * @return This builder for chaining. - */ - public Builder setAmplitudes( - int index, long value) { - ensureAmplitudesIsMutable(); - amplitudes_.setLong(index, value); - onChanged(); - return this; - } - /** - *
-             * Array of amplitudes of events in channels
-             * 
- * - * repeated uint64 amplitudes = 2; - * @param value The amplitudes to add. - * @return This builder for chaining. - */ - public Builder addAmplitudes(long value) { - ensureAmplitudesIsMutable(); - amplitudes_.addLong(value); - onChanged(); - return this; - } - /** - *
-             * Array of amplitudes of events in channels
-             * 
- * - * repeated uint64 amplitudes = 2; - * @param values The amplitudes to add. - * @return This builder for chaining. - */ - public Builder addAllAmplitudes( - java.lang.Iterable values) { - ensureAmplitudesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, amplitudes_); - onChanged(); - return this; - } - /** - *
-             * Array of amplitudes of events in channels
-             * 
- * - * repeated uint64 amplitudes = 2; - * @return This builder for chaining. - */ - public Builder clearAmplitudes() { - amplitudes_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:ru.inr.mass.data.proto.Point.Channel.Block.Events) - } - - // @@protoc_insertion_point(class_scope:ru.inr.mass.data.proto.Point.Channel.Block.Events) - private static final ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events(); - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Events parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Events(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int TIME_FIELD_NUMBER = 1; - private long time_; - /** - *
-         * Block start in epoch nanos
-         * 
- * - * uint64 time = 1; - * @return The time. - */ - @java.lang.Override - public long getTime() { - return time_; - } - - public static final int FRAMES_FIELD_NUMBER = 2; - private java.util.List frames_; - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - @java.lang.Override - public java.util.List getFramesList() { - return frames_; - } - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - @java.lang.Override - public java.util.List - getFramesOrBuilderList() { - return frames_; - } - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - @java.lang.Override - public int getFramesCount() { - return frames_.size(); - } - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame getFrames(int index) { - return frames_.get(index); - } - /** - *
-         * Frames array
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.FrameOrBuilder getFramesOrBuilder( - int index) { - return frames_.get(index); - } - - public static final int EVENTS_FIELD_NUMBER = 3; - private ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events events_; - /** - *
-         * Events array
-         * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - * @return Whether the events field is set. - */ - @java.lang.Override - public boolean hasEvents() { - return events_ != null; - } - /** - *
-         * Events array
-         * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - * @return The events. - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events getEvents() { - return events_ == null ? ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.getDefaultInstance() : events_; - } - /** - *
-         * Events array
-         * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.EventsOrBuilder getEventsOrBuilder() { - return getEvents(); - } - - public static final int LENGTH_FIELD_NUMBER = 4; - private long length_; - /** - *
-         * block size in nanos. If missing, take from meta.
-         * 
- * - * uint64 length = 4; - * @return The length. - */ - @java.lang.Override - public long getLength() { - return length_; - } - - public static final int BIN_SIZE_FIELD_NUMBER = 5; - private long binSize_; - /** - *
-         * tick size in nanos. Obsolete, to be removed
-         * 
- * - * uint64 bin_size = 5; - * @return The binSize. - */ - @java.lang.Override - public long getBinSize() { - return binSize_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (time_ != 0L) { - output.writeUInt64(1, time_); - } - for (int i = 0; i < frames_.size(); i++) { - output.writeMessage(2, frames_.get(i)); - } - if (events_ != null) { - output.writeMessage(3, getEvents()); - } - if (length_ != 0L) { - output.writeUInt64(4, length_); - } - if (binSize_ != 0L) { - output.writeUInt64(5, binSize_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (time_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, time_); - } - for (int i = 0; i < frames_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, frames_.get(i)); - } - if (events_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getEvents()); - } - if (length_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(4, length_); - } - if (binSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(5, binSize_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel.Block)) { - return super.equals(obj); - } - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block other = (ru.inr.mass.data.proto.NumassProto.Point.Channel.Block) obj; - - if (getTime() - != other.getTime()) return false; - if (!getFramesList() - .equals(other.getFramesList())) return false; - if (hasEvents() != other.hasEvents()) return false; - if (hasEvents()) { - if (!getEvents() - .equals(other.getEvents())) return false; - } - if (getLength() - != other.getLength()) return false; - if (getBinSize() - != other.getBinSize()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTime()); - if (getFramesCount() > 0) { - hash = (37 * hash) + FRAMES_FIELD_NUMBER; - hash = (53 * hash) + getFramesList().hashCode(); - } - if (hasEvents()) { - hash = (37 * hash) + EVENTS_FIELD_NUMBER; - hash = (53 * hash) + getEvents().hashCode(); - } - hash = (37 * hash) + LENGTH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLength()); - hash = (37 * hash) + BIN_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBinSize()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-         *A continuous measurement block
-         * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel.Block} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:ru.inr.mass.data.proto.Point.Channel.Block) - ru.inr.mass.data.proto.NumassProto.Point.Channel.BlockOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder.class); - } - - // Construct using ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getFramesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - time_ = 0L; - - if (framesBuilder_ == null) { - frames_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - framesBuilder_.clear(); - } - if (eventsBuilder_ == null) { - events_ = null; - } else { - events_ = null; - eventsBuilder_ = null; - } - length_ = 0L; - - binSize_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block getDefaultInstanceForType() { - return ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.getDefaultInstance(); - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block build() { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block buildPartial() { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block result = new ru.inr.mass.data.proto.NumassProto.Point.Channel.Block(this); - int from_bitField0_ = bitField0_; - result.time_ = time_; - if (framesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - frames_ = java.util.Collections.unmodifiableList(frames_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.frames_ = frames_; - } else { - result.frames_ = framesBuilder_.build(); - } - if (eventsBuilder_ == null) { - result.events_ = events_; - } else { - result.events_ = eventsBuilder_.build(); - } - result.length_ = length_; - result.binSize_ = binSize_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel.Block) { - return mergeFrom((ru.inr.mass.data.proto.NumassProto.Point.Channel.Block)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block other) { - if (other == ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.getDefaultInstance()) return this; - if (other.getTime() != 0L) { - setTime(other.getTime()); - } - if (framesBuilder_ == null) { - if (!other.frames_.isEmpty()) { - if (frames_.isEmpty()) { - frames_ = other.frames_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFramesIsMutable(); - frames_.addAll(other.frames_); - } - onChanged(); - } - } else { - if (!other.frames_.isEmpty()) { - if (framesBuilder_.isEmpty()) { - framesBuilder_.dispose(); - framesBuilder_ = null; - frames_ = other.frames_; - bitField0_ = (bitField0_ & ~0x00000001); - framesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFramesFieldBuilder() : null; - } else { - framesBuilder_.addAllMessages(other.frames_); - } - } - } - if (other.hasEvents()) { - mergeEvents(other.getEvents()); - } - if (other.getLength() != 0L) { - setLength(other.getLength()); - } - if (other.getBinSize() != 0L) { - setBinSize(other.getBinSize()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ru.inr.mass.data.proto.NumassProto.Point.Channel.Block) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long time_ ; - /** - *
-           * Block start in epoch nanos
-           * 
- * - * uint64 time = 1; - * @return The time. - */ - @java.lang.Override - public long getTime() { - return time_; - } - /** - *
-           * Block start in epoch nanos
-           * 
- * - * uint64 time = 1; - * @param value The time to set. - * @return This builder for chaining. - */ - public Builder setTime(long value) { - - time_ = value; - onChanged(); - return this; - } - /** - *
-           * Block start in epoch nanos
-           * 
- * - * uint64 time = 1; - * @return This builder for chaining. - */ - public Builder clearTime() { - - time_ = 0L; - onChanged(); - return this; - } - - private java.util.List frames_ = - java.util.Collections.emptyList(); - private void ensureFramesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - frames_ = new java.util.ArrayList(frames_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.FrameOrBuilder> framesBuilder_; - - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public java.util.List getFramesList() { - if (framesBuilder_ == null) { - return java.util.Collections.unmodifiableList(frames_); - } else { - return framesBuilder_.getMessageList(); - } - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public int getFramesCount() { - if (framesBuilder_ == null) { - return frames_.size(); - } else { - return framesBuilder_.getCount(); - } - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame getFrames(int index) { - if (framesBuilder_ == null) { - return frames_.get(index); - } else { - return framesBuilder_.getMessage(index); - } - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder setFrames( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame value) { - if (framesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFramesIsMutable(); - frames_.set(index, value); - onChanged(); - } else { - framesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder setFrames( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder builderForValue) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.set(index, builderForValue.build()); - onChanged(); - } else { - framesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder addFrames(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame value) { - if (framesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFramesIsMutable(); - frames_.add(value); - onChanged(); - } else { - framesBuilder_.addMessage(value); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder addFrames( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame value) { - if (framesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFramesIsMutable(); - frames_.add(index, value); - onChanged(); - } else { - framesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder addFrames( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder builderForValue) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.add(builderForValue.build()); - onChanged(); - } else { - framesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder addFrames( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder builderForValue) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.add(index, builderForValue.build()); - onChanged(); - } else { - framesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder addAllFrames( - java.lang.Iterable values) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, frames_); - onChanged(); - } else { - framesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder clearFrames() { - if (framesBuilder_ == null) { - frames_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - framesBuilder_.clear(); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public Builder removeFrames(int index) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.remove(index); - onChanged(); - } else { - framesBuilder_.remove(index); - } - return this; - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder getFramesBuilder( - int index) { - return getFramesFieldBuilder().getBuilder(index); - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.FrameOrBuilder getFramesOrBuilder( - int index) { - if (framesBuilder_ == null) { - return frames_.get(index); } else { - return framesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public java.util.List - getFramesOrBuilderList() { - if (framesBuilder_ != null) { - return framesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(frames_); - } - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder addFramesBuilder() { - return getFramesFieldBuilder().addBuilder( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.getDefaultInstance()); - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder addFramesBuilder( - int index) { - return getFramesFieldBuilder().addBuilder( - index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.getDefaultInstance()); - } - /** - *
-           * Frames array
-           * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block.Frame frames = 2; - */ - public java.util.List - getFramesBuilderList() { - return getFramesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.FrameOrBuilder> - getFramesFieldBuilder() { - if (framesBuilder_ == null) { - framesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Frame.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.FrameOrBuilder>( - frames_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - frames_ = null; - } - return framesBuilder_; - } - - private ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events events_; - private com.google.protobuf.SingleFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.EventsOrBuilder> eventsBuilder_; - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - * @return Whether the events field is set. - */ - public boolean hasEvents() { - return eventsBuilder_ != null || events_ != null; - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - * @return The events. - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events getEvents() { - if (eventsBuilder_ == null) { - return events_ == null ? ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.getDefaultInstance() : events_; - } else { - return eventsBuilder_.getMessage(); - } - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - public Builder setEvents(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events value) { - if (eventsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - events_ = value; - onChanged(); - } else { - eventsBuilder_.setMessage(value); - } - - return this; - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - public Builder setEvents( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder builderForValue) { - if (eventsBuilder_ == null) { - events_ = builderForValue.build(); - onChanged(); - } else { - eventsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - public Builder mergeEvents(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events value) { - if (eventsBuilder_ == null) { - if (events_ != null) { - events_ = - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.newBuilder(events_).mergeFrom(value).buildPartial(); - } else { - events_ = value; - } - onChanged(); - } else { - eventsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - public Builder clearEvents() { - if (eventsBuilder_ == null) { - events_ = null; - onChanged(); - } else { - events_ = null; - eventsBuilder_ = null; - } - - return this; - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder getEventsBuilder() { - - onChanged(); - return getEventsFieldBuilder().getBuilder(); - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.EventsOrBuilder getEventsOrBuilder() { - if (eventsBuilder_ != null) { - return eventsBuilder_.getMessageOrBuilder(); - } else { - return events_ == null ? - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.getDefaultInstance() : events_; - } - } - /** - *
-           * Events array
-           * 
- * - * .ru.inr.mass.data.proto.Point.Channel.Block.Events events = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.EventsOrBuilder> - getEventsFieldBuilder() { - if (eventsBuilder_ == null) { - eventsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Events.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.EventsOrBuilder>( - getEvents(), - getParentForChildren(), - isClean()); - events_ = null; - } - return eventsBuilder_; - } - - private long length_ ; - /** - *
-           * block size in nanos. If missing, take from meta.
-           * 
- * - * uint64 length = 4; - * @return The length. - */ - @java.lang.Override - public long getLength() { - return length_; - } - /** - *
-           * block size in nanos. If missing, take from meta.
-           * 
- * - * uint64 length = 4; - * @param value The length to set. - * @return This builder for chaining. - */ - public Builder setLength(long value) { - - length_ = value; - onChanged(); - return this; - } - /** - *
-           * block size in nanos. If missing, take from meta.
-           * 
- * - * uint64 length = 4; - * @return This builder for chaining. - */ - public Builder clearLength() { - - length_ = 0L; - onChanged(); - return this; - } - - private long binSize_ ; - /** - *
-           * tick size in nanos. Obsolete, to be removed
-           * 
- * - * uint64 bin_size = 5; - * @return The binSize. - */ - @java.lang.Override - public long getBinSize() { - return binSize_; - } - /** - *
-           * tick size in nanos. Obsolete, to be removed
-           * 
- * - * uint64 bin_size = 5; - * @param value The binSize to set. - * @return This builder for chaining. - */ - public Builder setBinSize(long value) { - - binSize_ = value; - onChanged(); - return this; - } - /** - *
-           * tick size in nanos. Obsolete, to be removed
-           * 
- * - * uint64 bin_size = 5; - * @return This builder for chaining. - */ - public Builder clearBinSize() { - - binSize_ = 0L; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:ru.inr.mass.data.proto.Point.Channel.Block) - } - - // @@protoc_insertion_point(class_scope:ru.inr.mass.data.proto.Point.Channel.Block) - private static final ru.inr.mass.data.proto.NumassProto.Point.Channel.Block DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new ru.inr.mass.data.proto.NumassProto.Point.Channel.Block(); - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel.Block getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Block parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Block(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_; - /** - *
-       * The number of measuring channel
-       * 
- * - * uint64 id = 1; - * @return The id. - */ - @java.lang.Override - public long getId() { - return id_; - } - - public static final int BLOCKS_FIELD_NUMBER = 2; - private java.util.List blocks_; - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - @java.lang.Override - public java.util.List getBlocksList() { - return blocks_; - } - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - @java.lang.Override - public java.util.List - getBlocksOrBuilderList() { - return blocks_; - } - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - @java.lang.Override - public int getBlocksCount() { - return blocks_.size(); - } - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block getBlocks(int index) { - return blocks_.get(index); - } - /** - *
-       * Blocks
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel.BlockOrBuilder getBlocksOrBuilder( - int index) { - return blocks_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0L) { - output.writeUInt64(1, id_); - } - for (int i = 0; i < blocks_.size(); i++) { - output.writeMessage(2, blocks_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, id_); - } - for (int i = 0; i < blocks_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, blocks_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel)) { - return super.equals(obj); - } - ru.inr.mass.data.proto.NumassProto.Point.Channel other = (ru.inr.mass.data.proto.NumassProto.Point.Channel) obj; - - if (getId() - != other.getId()) return false; - if (!getBlocksList() - .equals(other.getBlocksList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getId()); - if (getBlocksCount() > 0) { - hash = (37 * hash) + BLOCKS_FIELD_NUMBER; - hash = (53 * hash) + getBlocksList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point.Channel parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(ru.inr.mass.data.proto.NumassProto.Point.Channel prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-       * A single channel for multichannel detector readout
-       * 
- * - * Protobuf type {@code ru.inr.mass.data.proto.Point.Channel} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:ru.inr.mass.data.proto.Point.Channel) - ru.inr.mass.data.proto.NumassProto.Point.ChannelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.Channel.class, ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder.class); - } - - // Construct using ru.inr.mass.data.proto.NumassProto.Point.Channel.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getBlocksFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0L; - - if (blocksBuilder_ == null) { - blocks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - blocksBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_Channel_descriptor; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel getDefaultInstanceForType() { - return ru.inr.mass.data.proto.NumassProto.Point.Channel.getDefaultInstance(); - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel build() { - ru.inr.mass.data.proto.NumassProto.Point.Channel result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel buildPartial() { - ru.inr.mass.data.proto.NumassProto.Point.Channel result = new ru.inr.mass.data.proto.NumassProto.Point.Channel(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - if (blocksBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - blocks_ = java.util.Collections.unmodifiableList(blocks_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.blocks_ = blocks_; - } else { - result.blocks_ = blocksBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ru.inr.mass.data.proto.NumassProto.Point.Channel) { - return mergeFrom((ru.inr.mass.data.proto.NumassProto.Point.Channel)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ru.inr.mass.data.proto.NumassProto.Point.Channel other) { - if (other == ru.inr.mass.data.proto.NumassProto.Point.Channel.getDefaultInstance()) return this; - if (other.getId() != 0L) { - setId(other.getId()); - } - if (blocksBuilder_ == null) { - if (!other.blocks_.isEmpty()) { - if (blocks_.isEmpty()) { - blocks_ = other.blocks_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBlocksIsMutable(); - blocks_.addAll(other.blocks_); - } - onChanged(); - } - } else { - if (!other.blocks_.isEmpty()) { - if (blocksBuilder_.isEmpty()) { - blocksBuilder_.dispose(); - blocksBuilder_ = null; - blocks_ = other.blocks_; - bitField0_ = (bitField0_ & ~0x00000001); - blocksBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getBlocksFieldBuilder() : null; - } else { - blocksBuilder_.addAllMessages(other.blocks_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ru.inr.mass.data.proto.NumassProto.Point.Channel parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ru.inr.mass.data.proto.NumassProto.Point.Channel) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long id_ ; - /** - *
-         * The number of measuring channel
-         * 
- * - * uint64 id = 1; - * @return The id. - */ - @java.lang.Override - public long getId() { - return id_; - } - /** - *
-         * The number of measuring channel
-         * 
- * - * uint64 id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(long value) { - - id_ = value; - onChanged(); - return this; - } - /** - *
-         * The number of measuring channel
-         * 
- * - * uint64 id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0L; - onChanged(); - return this; - } - - private java.util.List blocks_ = - java.util.Collections.emptyList(); - private void ensureBlocksIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - blocks_ = new java.util.ArrayList(blocks_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.BlockOrBuilder> blocksBuilder_; - - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public java.util.List getBlocksList() { - if (blocksBuilder_ == null) { - return java.util.Collections.unmodifiableList(blocks_); - } else { - return blocksBuilder_.getMessageList(); - } - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public int getBlocksCount() { - if (blocksBuilder_ == null) { - return blocks_.size(); - } else { - return blocksBuilder_.getCount(); - } - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block getBlocks(int index) { - if (blocksBuilder_ == null) { - return blocks_.get(index); - } else { - return blocksBuilder_.getMessage(index); - } - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder setBlocks( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block value) { - if (blocksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlocksIsMutable(); - blocks_.set(index, value); - onChanged(); - } else { - blocksBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder setBlocks( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder builderForValue) { - if (blocksBuilder_ == null) { - ensureBlocksIsMutable(); - blocks_.set(index, builderForValue.build()); - onChanged(); - } else { - blocksBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder addBlocks(ru.inr.mass.data.proto.NumassProto.Point.Channel.Block value) { - if (blocksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlocksIsMutable(); - blocks_.add(value); - onChanged(); - } else { - blocksBuilder_.addMessage(value); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder addBlocks( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block value) { - if (blocksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlocksIsMutable(); - blocks_.add(index, value); - onChanged(); - } else { - blocksBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder addBlocks( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder builderForValue) { - if (blocksBuilder_ == null) { - ensureBlocksIsMutable(); - blocks_.add(builderForValue.build()); - onChanged(); - } else { - blocksBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder addBlocks( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder builderForValue) { - if (blocksBuilder_ == null) { - ensureBlocksIsMutable(); - blocks_.add(index, builderForValue.build()); - onChanged(); - } else { - blocksBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder addAllBlocks( - java.lang.Iterable values) { - if (blocksBuilder_ == null) { - ensureBlocksIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, blocks_); - onChanged(); - } else { - blocksBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder clearBlocks() { - if (blocksBuilder_ == null) { - blocks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - blocksBuilder_.clear(); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public Builder removeBlocks(int index) { - if (blocksBuilder_ == null) { - ensureBlocksIsMutable(); - blocks_.remove(index); - onChanged(); - } else { - blocksBuilder_.remove(index); - } - return this; - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder getBlocksBuilder( - int index) { - return getBlocksFieldBuilder().getBuilder(index); - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.BlockOrBuilder getBlocksOrBuilder( - int index) { - if (blocksBuilder_ == null) { - return blocks_.get(index); } else { - return blocksBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public java.util.List - getBlocksOrBuilderList() { - if (blocksBuilder_ != null) { - return blocksBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(blocks_); - } - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder addBlocksBuilder() { - return getBlocksFieldBuilder().addBuilder( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.getDefaultInstance()); - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder addBlocksBuilder( - int index) { - return getBlocksFieldBuilder().addBuilder( - index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.getDefaultInstance()); - } - /** - *
-         * Blocks
-         * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel.Block blocks = 2; - */ - public java.util.List - getBlocksBuilderList() { - return getBlocksFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.BlockOrBuilder> - getBlocksFieldBuilder() { - if (blocksBuilder_ == null) { - blocksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel.Block, ru.inr.mass.data.proto.NumassProto.Point.Channel.Block.Builder, ru.inr.mass.data.proto.NumassProto.Point.Channel.BlockOrBuilder>( - blocks_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - blocks_ = null; - } - return blocksBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:ru.inr.mass.data.proto.Point.Channel) - } - - // @@protoc_insertion_point(class_scope:ru.inr.mass.data.proto.Point.Channel) - private static final ru.inr.mass.data.proto.NumassProto.Point.Channel DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new ru.inr.mass.data.proto.NumassProto.Point.Channel(); - } - - public static ru.inr.mass.data.proto.NumassProto.Point.Channel getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Channel parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Channel(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int CHANNELS_FIELD_NUMBER = 1; - private java.util.List channels_; - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - @java.lang.Override - public java.util.List getChannelsList() { - return channels_; - } - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - @java.lang.Override - public java.util.List - getChannelsOrBuilderList() { - return channels_; - } - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - @java.lang.Override - public int getChannelsCount() { - return channels_.size(); - } - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.Channel getChannels(int index) { - return channels_.get(index); - } - /** - *
-     * Array of measuring channels
-     * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point.ChannelOrBuilder getChannelsOrBuilder( - int index) { - return channels_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < channels_.size(); i++) { - output.writeMessage(1, channels_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < channels_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, channels_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ru.inr.mass.data.proto.NumassProto.Point)) { - return super.equals(obj); - } - ru.inr.mass.data.proto.NumassProto.Point other = (ru.inr.mass.data.proto.NumassProto.Point) obj; - - if (!getChannelsList() - .equals(other.getChannelsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getChannelsCount() > 0) { - hash = (37 * hash) + CHANNELS_FIELD_NUMBER; - hash = (53 * hash) + getChannelsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static ru.inr.mass.data.proto.NumassProto.Point parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(ru.inr.mass.data.proto.NumassProto.Point prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code ru.inr.mass.data.proto.Point} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:ru.inr.mass.data.proto.Point) - ru.inr.mass.data.proto.NumassProto.PointOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ru.inr.mass.data.proto.NumassProto.Point.class, ru.inr.mass.data.proto.NumassProto.Point.Builder.class); - } - - // Construct using ru.inr.mass.data.proto.NumassProto.Point.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getChannelsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (channelsBuilder_ == null) { - channels_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - channelsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ru.inr.mass.data.proto.NumassProto.internal_static_ru_inr_mass_data_proto_Point_descriptor; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point getDefaultInstanceForType() { - return ru.inr.mass.data.proto.NumassProto.Point.getDefaultInstance(); - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point build() { - ru.inr.mass.data.proto.NumassProto.Point result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point buildPartial() { - ru.inr.mass.data.proto.NumassProto.Point result = new ru.inr.mass.data.proto.NumassProto.Point(this); - int from_bitField0_ = bitField0_; - if (channelsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - channels_ = java.util.Collections.unmodifiableList(channels_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.channels_ = channels_; - } else { - result.channels_ = channelsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ru.inr.mass.data.proto.NumassProto.Point) { - return mergeFrom((ru.inr.mass.data.proto.NumassProto.Point)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ru.inr.mass.data.proto.NumassProto.Point other) { - if (other == ru.inr.mass.data.proto.NumassProto.Point.getDefaultInstance()) return this; - if (channelsBuilder_ == null) { - if (!other.channels_.isEmpty()) { - if (channels_.isEmpty()) { - channels_ = other.channels_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureChannelsIsMutable(); - channels_.addAll(other.channels_); - } - onChanged(); - } - } else { - if (!other.channels_.isEmpty()) { - if (channelsBuilder_.isEmpty()) { - channelsBuilder_.dispose(); - channelsBuilder_ = null; - channels_ = other.channels_; - bitField0_ = (bitField0_ & ~0x00000001); - channelsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getChannelsFieldBuilder() : null; - } else { - channelsBuilder_.addAllMessages(other.channels_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ru.inr.mass.data.proto.NumassProto.Point parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ru.inr.mass.data.proto.NumassProto.Point) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List channels_ = - java.util.Collections.emptyList(); - private void ensureChannelsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - channels_ = new java.util.ArrayList(channels_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel, ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder, ru.inr.mass.data.proto.NumassProto.Point.ChannelOrBuilder> channelsBuilder_; - - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public java.util.List getChannelsList() { - if (channelsBuilder_ == null) { - return java.util.Collections.unmodifiableList(channels_); - } else { - return channelsBuilder_.getMessageList(); - } - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public int getChannelsCount() { - if (channelsBuilder_ == null) { - return channels_.size(); - } else { - return channelsBuilder_.getCount(); - } - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel getChannels(int index) { - if (channelsBuilder_ == null) { - return channels_.get(index); - } else { - return channelsBuilder_.getMessage(index); - } - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder setChannels( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel value) { - if (channelsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChannelsIsMutable(); - channels_.set(index, value); - onChanged(); - } else { - channelsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder setChannels( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder builderForValue) { - if (channelsBuilder_ == null) { - ensureChannelsIsMutable(); - channels_.set(index, builderForValue.build()); - onChanged(); - } else { - channelsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder addChannels(ru.inr.mass.data.proto.NumassProto.Point.Channel value) { - if (channelsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChannelsIsMutable(); - channels_.add(value); - onChanged(); - } else { - channelsBuilder_.addMessage(value); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder addChannels( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel value) { - if (channelsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChannelsIsMutable(); - channels_.add(index, value); - onChanged(); - } else { - channelsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder addChannels( - ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder builderForValue) { - if (channelsBuilder_ == null) { - ensureChannelsIsMutable(); - channels_.add(builderForValue.build()); - onChanged(); - } else { - channelsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder addChannels( - int index, ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder builderForValue) { - if (channelsBuilder_ == null) { - ensureChannelsIsMutable(); - channels_.add(index, builderForValue.build()); - onChanged(); - } else { - channelsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder addAllChannels( - java.lang.Iterable values) { - if (channelsBuilder_ == null) { - ensureChannelsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, channels_); - onChanged(); - } else { - channelsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder clearChannels() { - if (channelsBuilder_ == null) { - channels_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - channelsBuilder_.clear(); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public Builder removeChannels(int index) { - if (channelsBuilder_ == null) { - ensureChannelsIsMutable(); - channels_.remove(index); - onChanged(); - } else { - channelsBuilder_.remove(index); - } - return this; - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder getChannelsBuilder( - int index) { - return getChannelsFieldBuilder().getBuilder(index); - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public ru.inr.mass.data.proto.NumassProto.Point.ChannelOrBuilder getChannelsOrBuilder( - int index) { - if (channelsBuilder_ == null) { - return channels_.get(index); } else { - return channelsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public java.util.List - getChannelsOrBuilderList() { - if (channelsBuilder_ != null) { - return channelsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(channels_); - } - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder addChannelsBuilder() { - return getChannelsFieldBuilder().addBuilder( - ru.inr.mass.data.proto.NumassProto.Point.Channel.getDefaultInstance()); - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder addChannelsBuilder( - int index) { - return getChannelsFieldBuilder().addBuilder( - index, ru.inr.mass.data.proto.NumassProto.Point.Channel.getDefaultInstance()); - } - /** - *
-       * Array of measuring channels
-       * 
- * - * repeated .ru.inr.mass.data.proto.Point.Channel channels = 1; - */ - public java.util.List - getChannelsBuilderList() { - return getChannelsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel, ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder, ru.inr.mass.data.proto.NumassProto.Point.ChannelOrBuilder> - getChannelsFieldBuilder() { - if (channelsBuilder_ == null) { - channelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - ru.inr.mass.data.proto.NumassProto.Point.Channel, ru.inr.mass.data.proto.NumassProto.Point.Channel.Builder, ru.inr.mass.data.proto.NumassProto.Point.ChannelOrBuilder>( - channels_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - channels_ = null; - } - return channelsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:ru.inr.mass.data.proto.Point) - } - - // @@protoc_insertion_point(class_scope:ru.inr.mass.data.proto.Point) - private static final ru.inr.mass.data.proto.NumassProto.Point DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new ru.inr.mass.data.proto.NumassProto.Point(); - } - - public static ru.inr.mass.data.proto.NumassProto.Point getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Point parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Point(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public ru.inr.mass.data.proto.NumassProto.Point getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_ru_inr_mass_data_proto_Point_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_ru_inr_mass_data_proto_Point_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_ru_inr_mass_data_proto_Point_Channel_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_ru_inr_mass_data_proto_Point_Channel_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n)ru/inr/mass/data/proto/numass-proto.pr" + - "oto\022\026ru.inr.mass.data.proto\"\250\003\n\005Point\0227\n" + - "\010channels\030\001 \003(\0132%.ru.inr.mass.data.proto" + - ".Point.Channel\032\345\002\n\007Channel\022\n\n\002id\030\001 \001(\004\022;" + - "\n\006blocks\030\002 \003(\0132+.ru.inr.mass.data.proto." + - "Point.Channel.Block\032\220\002\n\005Block\022\014\n\004time\030\001 " + - "\001(\004\022A\n\006frames\030\002 \003(\01321.ru.inr.mass.data.p" + - "roto.Point.Channel.Block.Frame\022B\n\006events" + - "\030\003 \001(\01322.ru.inr.mass.data.proto.Point.Ch" + - "annel.Block.Events\022\016\n\006length\030\004 \001(\004\022\020\n\010bi" + - "n_size\030\005 \001(\004\032#\n\005Frame\022\014\n\004time\030\001 \001(\004\022\014\n\004d" + - "ata\030\002 \001(\014\032+\n\006Events\022\r\n\005times\030\001 \003(\004\022\022\n\nam" + - "plitudes\030\002 \003(\004b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_ru_inr_mass_data_proto_Point_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_ru_inr_mass_data_proto_Point_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_ru_inr_mass_data_proto_Point_descriptor, - new java.lang.String[] { "Channels", }); - internal_static_ru_inr_mass_data_proto_Point_Channel_descriptor = - internal_static_ru_inr_mass_data_proto_Point_descriptor.getNestedTypes().get(0); - internal_static_ru_inr_mass_data_proto_Point_Channel_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_ru_inr_mass_data_proto_Point_Channel_descriptor, - new java.lang.String[] { "Id", "Blocks", }); - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor = - internal_static_ru_inr_mass_data_proto_Point_Channel_descriptor.getNestedTypes().get(0); - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor, - new java.lang.String[] { "Time", "Frames", "Events", "Length", "BinSize", }); - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_descriptor = - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor.getNestedTypes().get(0); - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Frame_descriptor, - new java.lang.String[] { "Time", "Data", }); - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_descriptor = - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_descriptor.getNestedTypes().get(1); - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_ru_inr_mass_data_proto_Point_Channel_Block_Events_descriptor, - new java.lang.String[] { "Times", "Amplitudes", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassDirectorySet.kt b/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassDirectorySet.kt index ffee513..6f18b9f 100644 --- a/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassDirectorySet.kt +++ b/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassDirectorySet.kt @@ -10,10 +10,7 @@ import ru.inr.mass.data.api.NumassPoint import ru.inr.mass.data.api.NumassSet import java.nio.file.Files import java.nio.file.Path -import kotlin.io.path.ExperimentalPathApi -import kotlin.io.path.div -import kotlin.io.path.exists -import kotlin.io.path.isDirectory +import kotlin.io.path.* import kotlin.streams.toList @OptIn(ExperimentalPathApi::class) @@ -35,7 +32,9 @@ public class NumassDirectorySet internal constructor( } override val points: List by lazy> { - Files.list(path).filter { it.fileName.startsWith("p") }.map { pointPath -> + Files.list(path).filter { + it.fileName.name.startsWith("p") + }.map { pointPath -> try { context.readNumassFile(pointPath) } catch (e: Exception) { diff --git a/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassEnvelopeType.kt b/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassEnvelopeType.kt deleted file mode 100644 index 2fa3e35..0000000 --- a/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassEnvelopeType.kt +++ /dev/null @@ -1,139 +0,0 @@ -///* -// * Copyright 2018 Alexander Nozik. -// * -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ -// -//package ru.inr.mass.data.proto -// -//import hep.dataforge.io.envelopes.* -//import hep.dataforge.values.Value -//import org.slf4j.LoggerFactory -//import java.io.IOException -//import java.nio.ByteBuffer -//import java.nio.channels.FileChannel -//import java.nio.file.Path -//import java.nio.file.StandardOpenOption -//import java.util.* -// -///** -// * An envelope type for legacy numass tags. Reads legacy tag and writes DF02 tags -// */ -//class NumassEnvelopeType : EnvelopeType { -// -// override val code: Int = DefaultEnvelopeType.DEFAULT_ENVELOPE_CODE -// -// override val name: String = "numass" -// -// override fun description(): String = "Numass legacy envelope" -// -// /** -// * Read as legacy -// */ -// override fun getReader(properties: Map): EnvelopeReader { -// return NumassEnvelopeReader() -// } -// -// /** -// * Write as default -// */ -// override fun getWriter(properties: Map): EnvelopeWriter { -// return DefaultEnvelopeWriter(this, MetaType.resolve(properties)) -// } -// -// class LegacyTag : EnvelopeTag() { -// override val startSequence: ByteArray -// get() = LEGACY_START_SEQUENCE -// -// override val endSequence: ByteArray -// get() = LEGACY_END_SEQUENCE -// -// /** -// * Get the length of tag in bytes. -1 means undefined size in case tag was modified -// * -// * @return -// */ -// override val length: Int -// get() = 30 -// -// /** -// * Read leagscy version 1 tag without leading tag head -// * -// * @param buffer -// * @return -// * @throws IOException -// */ -// override fun readHeader(buffer: ByteBuffer): Map { -// val res = HashMap() -// -// val type = buffer.getInt(2) -// res[Envelope.TYPE_PROPERTY] = Value.of(type) -// -// val metaTypeCode = buffer.getShort(10) -// val metaType = MetaType.resolve(metaTypeCode) -// -// if (metaType != null) { -// res[Envelope.META_TYPE_PROPERTY] = metaType.name.parseValue() -// } else { -// LoggerFactory.getLogger(EnvelopeTag::class.java).warn("Could not resolve meta type. Using default") -// } -// -// val metaLength = Integer.toUnsignedLong(buffer.getInt(14)) -// res[Envelope.META_LENGTH_PROPERTY] = Value.of(metaLength) -// val dataLength = Integer.toUnsignedLong(buffer.getInt(22)) -// res[Envelope.DATA_LENGTH_PROPERTY] = Value.of(dataLength) -// return res -// } -// } -// -// private class NumassEnvelopeReader : DefaultEnvelopeReader() { -// override fun newTag(): EnvelopeTag { -// return LegacyTag() -// } -// } -// -// companion object { -// val INSTANCE = NumassEnvelopeType() -// -// val LEGACY_START_SEQUENCE = byteArrayOf('#'.toByte(), '!'.toByte()) -// val LEGACY_END_SEQUENCE = byteArrayOf('!'.toByte(), '#'.toByte(), '\r'.toByte(), '\n'.toByte()) -// -// /** -// * Replacement for standard type infer to include legacy type -// * -// * @param path -// * @return -// */ -// fun infer(path: Path): EnvelopeType? { -// return try { -// FileChannel.open(path, StandardOpenOption.READ).use { -// val buffer = it.map(FileChannel.MapMode.READ_ONLY, 0, 6) -// when { -// //TODO use templates from appropriate types -// buffer.get(0) == '#'.toByte() && buffer.get(1) == '!'.toByte() -> INSTANCE -// buffer.get(0) == '#'.toByte() && buffer.get(1) == '!'.toByte() && -// buffer.get(4) == 'T'.toByte() && buffer.get(5) == 'L'.toByte() -> TaglessEnvelopeType.INSTANCE -// buffer.get(0) == '#'.toByte() && buffer.get(1) == '~'.toByte() -> DefaultEnvelopeType.INSTANCE -// else -> null -// } -// } -// } catch (ex: Exception) { -// LoggerFactory.getLogger(EnvelopeType::class.java).warn("Could not infer envelope type of file {} due to exception: {}", path, ex) -// null -// } -// -// } -// -// } -// -//} diff --git a/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassProtoPlugin.kt b/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassProtoPlugin.kt index 883a7fd..d5deb69 100644 --- a/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassProtoPlugin.kt +++ b/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/NumassProtoPlugin.kt @@ -4,17 +4,27 @@ import hep.dataforge.context.AbstractPlugin import hep.dataforge.context.Context import hep.dataforge.context.PluginFactory import hep.dataforge.context.PluginTag +import hep.dataforge.io.EnvelopeFormatFactory import hep.dataforge.io.IOPlugin import hep.dataforge.meta.Meta +import hep.dataforge.names.Name import kotlin.reflect.KClass public class NumassProtoPlugin : AbstractPlugin() { public val io: IOPlugin by require(IOPlugin) override val tag: PluginTag get() = Companion.tag + override fun content(target: String): Map { + return if(target== EnvelopeFormatFactory.ENVELOPE_FORMAT_TYPE){ + mapOf(TaggedNumassEnvelopeFormat.name to TaggedNumassEnvelopeFormat) + } else{ + super.content(target) + } + } + public companion object : PluginFactory { override fun invoke(meta: Meta, context: Context): NumassProtoPlugin = NumassProtoPlugin() override val tag: PluginTag = PluginTag("numass-proto", group = "ru.inr.mass") override val type: KClass = NumassProtoPlugin::class } -} \ No newline at end of file +} diff --git a/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/TaggedNumassEnvelopeFormat.kt b/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/TaggedNumassEnvelopeFormat.kt new file mode 100644 index 0000000..74aad61 --- /dev/null +++ b/numass-data-proto/src/main/kotlin/ru/inr/mass/data/proto/TaggedNumassEnvelopeFormat.kt @@ -0,0 +1,295 @@ +/* + * Copyright 2018 Alexander Nozik. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ru.inr.mass.data.proto + +import hep.dataforge.context.Context +import hep.dataforge.io.* +import hep.dataforge.meta.Meta +import hep.dataforge.meta.get +import hep.dataforge.meta.string +import hep.dataforge.names.Name +import hep.dataforge.names.plus +import hep.dataforge.names.toName +import kotlinx.io.* +import java.util.* + + +/** + * A streaming-friendly envelope format with a short binary tag. + * TODO add description + */ +public class TaggedNumassEnvelopeFormat(private val io: IOPlugin) : EnvelopeFormat { + +// private val metaFormat = io.metaFormat(metaFormatKey) +// ?: error("Meta format with key $metaFormatKey could not be resolved in $io") + + + private fun Tag.toBinary() = Binary(24) { + writeRawString(START_SEQUENCE) + writeRawString("DFNU") + writeShort(metaFormatKey) + writeUInt(metaSize) + writeUInt(dataSize.toUInt()) + writeRawString(END_SEQUENCE) + } + + override fun writeEnvelope( + output: Output, + envelope: Envelope, + metaFormatFactory: MetaFormatFactory, + formatMeta: Meta, + ) { + error("Don't write legacy formats") +// val metaFormat = metaFormatFactory.invoke(formatMeta, io.context) +// val metaBytes = metaFormat.toBinary(envelope.meta) +// val actualSize: ULong = (envelope.data?.size ?: 0).toULong() +// val tag = Tag(metaFormatFactory.key, metaBytes.size.toUInt() + 2u, actualSize) +// output.writeBinary(tag.toBinary()) +// output.writeBinary(metaBytes) +// output.writeRawString("\r\n") +// envelope.data?.let { +// output.writeBinary(it) +// } +// output.flush() + } + + /** + * Read an envelope from input into memory + * + * @param input an input to read from + * @param formats a collection of meta formats to resolve + */ + override fun readObject(input: Input): Envelope { + val tag = input.readTag() + + val metaFormat = io.resolveMetaFormat(tag.metaFormatKey) + ?: error("Meta format with key ${tag.metaFormatKey} not found") + + val meta: Meta = metaFormat.readObject(input.limit(tag.metaSize.toInt())) + + val data = input.readBinary(tag.dataSize.toInt()) + + return SimpleEnvelope(meta, data) + } + + override fun readPartial(input: Input): PartialEnvelope { + val tag = input.readTag() + + val metaFormat = if (tag.metaFormatKey == 1.toShort()) { + JsonMetaFormat + } else { + io.resolveMetaFormat(tag.metaFormatKey) + ?: error("Meta format with key ${tag.metaFormatKey} not found") + } + + val meta: Meta = metaFormat.readObject(input.limit(tag.metaSize.toInt())) + + + return PartialEnvelope(meta, 30u + tag.metaSize, tag.dataSize) + } + + private data class Tag( + val metaFormatKey: Short, + val metaSize: UInt, + val dataSize: ULong, + ) + + override fun toMeta(): Meta = Meta { + IOFormat.NAME_KEY put name.toString() + } + + public companion object : EnvelopeFormatFactory { + private const val START_SEQUENCE = "#!" + private const val END_SEQUENCE = "!#\r\n" + + override val name: Name = super.name + "numass" + + override fun invoke(meta: Meta, context: Context): EnvelopeFormat { + val io = context.io + + val metaFormatName = meta["name"].string?.toName() ?: JsonMetaFormat.name + //Check if appropriate factory exists + io.metaFormatFactories.find { it.name == metaFormatName } ?: error("Meta format could not be resolved") + + return TaggedNumassEnvelopeFormat(io) + } + + private fun Input.readTag(): Tag { + val start = readRawString(2) + if (start != START_SEQUENCE) error("The input is not an envelope") + val versionString = readRawString(4) + val junk1 = readInt() + val metaFormatKey = readShort() + val junk2 = readShort() + val metaLength = readUInt() + val dataLength: ULong = readULong() + val end = readRawString(4) + if (end != END_SEQUENCE) error("The input is not an envelope") + return Tag(metaFormatKey, metaLength, dataLength) + } + + override fun peekFormat(io: IOPlugin, input: Input): EnvelopeFormat? { + return try { + input.preview { + val header = readRawString(30) + if (header.startsWith(START_SEQUENCE) && header.endsWith(END_SEQUENCE)) { + TaggedNumassEnvelopeFormat(io) + } else { + null + } + } + } catch (ex: Exception) { + null + } + } + + private val default by lazy { invoke() } + + override fun readPartial(input: Input): PartialEnvelope = + default.run { readPartial(input) } + + override fun writeEnvelope( + output: Output, + envelope: Envelope, + metaFormatFactory: MetaFormatFactory, + formatMeta: Meta, + ): Unit = default.run { + writeEnvelope( + output, + envelope, + metaFormatFactory, + formatMeta + ) + } + + override fun readObject(input: Input): Envelope = default.readObject(input) + } + +} + + +///** +// * An envelope type for legacy numass tags. Reads legacy tag and writes DF02 tags +// */ +//object NumassEnvelopeType : EnvelopeFormatFactory { +// +// override val code: Int = DefaultEnvelopeType.DEFAULT_ENVELOPE_CODE +// +// override val name: String = "numass" +// +// override fun description(): String = "Numass legacy envelope" +// +// /** +// * Read as legacy +// */ +// override fun getReader(properties: Map): EnvelopeReader { +// return NumassEnvelopeReader() +// } +// +// /** +// * Write as default +// */ +// override fun getWriter(properties: Map): EnvelopeWriter { +// return DefaultEnvelopeWriter(this, MetaType.resolve(properties)) +// } +// +// class LegacyTag : EnvelopeTag() { +// override val startSequence: ByteArray +// get() = LEGACY_START_SEQUENCE +// +// override val endSequence: ByteArray +// get() = LEGACY_END_SEQUENCE +// +// /** +// * Get the length of tag in bytes. -1 means undefined size in case tag was modified +// * +// * @return +// */ +// override val length: Int +// get() = 30 +// +// /** +// * Read leagscy version 1 tag without leading tag head +// * +// * @param buffer +// * @return +// * @throws IOException +// */ +// override fun readHeader(buffer: ByteBuffer): Map { +// val res = HashMap() +// +// val type = buffer.getInt(2) +// res[Envelope.TYPE_PROPERTY] = Value.of(type) +// +// val metaTypeCode = buffer.getShort(10) +// val metaType = MetaType.resolve(metaTypeCode) +// +// if (metaType != null) { +// res[Envelope.META_TYPE_PROPERTY] = metaType.name.parseValue() +// } else { +// LoggerFactory.getLogger(EnvelopeTag::class.java).warn("Could not resolve meta type. Using default") +// } +// +// val metaLength = Integer.toUnsignedLong(buffer.getInt(14)) +// res[Envelope.META_LENGTH_PROPERTY] = Value.of(metaLength) +// val dataLength = Integer.toUnsignedLong(buffer.getInt(22)) +// res[Envelope.DATA_LENGTH_PROPERTY] = Value.of(dataLength) +// return res +// } +// } +// +// private class NumassEnvelopeReader : DefaultEnvelopeReader() { +// override fun newTag(): EnvelopeTag { +// return LegacyTag() +// } +// } +// +// companion object { +// val INSTANCE = NumassEnvelopeType() +// +// val LEGACY_START_SEQUENCE = byteArrayOf('#'.toByte(), '!'.toByte()) +// val LEGACY_END_SEQUENCE = byteArrayOf('!'.toByte(), '#'.toByte(), '\r'.toByte(), '\n'.toByte()) +// +// /** +// * Replacement for standard type infer to include legacy type +// * +// * @param path +// * @return +// */ +// fun infer(path: Path): EnvelopeType? { +// return try { +// FileChannel.open(path, StandardOpenOption.READ).use { +// val buffer = it.map(FileChannel.MapMode.READ_ONLY, 0, 6) +// when { +// //TODO use templates from appropriate types +// buffer.get(0) == '#'.toByte() && buffer.get(1) == '!'.toByte() -> INSTANCE +// buffer.get(0) == '#'.toByte() && buffer.get(1) == '!'.toByte() && +// buffer.get(4) == 'T'.toByte() && buffer.get(5) == 'L'.toByte() -> TaglessEnvelopeType.INSTANCE +// buffer.get(0) == '#'.toByte() && buffer.get(1) == '~'.toByte() -> DefaultEnvelopeType.INSTANCE +// else -> null +// } +// } +// } catch (ex: Exception) { +// LoggerFactory.getLogger(EnvelopeType::class.java).warn("Could not infer envelope type of file {} due to exception: {}", path, ex) +// null +// } +// +// } +// +// } +// +//} diff --git a/numass-data-proto/src/test/kotlin/ru/inr/mass/data/proto/TestNumassDirectory.kt b/numass-data-proto/src/test/kotlin/ru/inr/mass/data/proto/TestNumassDirectory.kt new file mode 100644 index 0000000..52e0646 --- /dev/null +++ b/numass-data-proto/src/test/kotlin/ru/inr/mass/data/proto/TestNumassDirectory.kt @@ -0,0 +1,26 @@ +package ru.inr.mass.data.proto + +import hep.dataforge.context.Context +import hep.dataforge.meta.get +import hep.dataforge.meta.string +import hep.dataforge.meta.value +import hep.dataforge.values.ListValue +import org.junit.jupiter.api.Test +import java.nio.file.Path +import kotlin.test.assertEquals + +class TestNumassDirectory { + val context = Context("numass-test") { + plugin(NumassProtoPlugin) + } + + @Test + fun testDirectoryRead() { + val dataPath = Path.of("src/test/resources", "testData/set_4") + val testSet = context.readNumassDirectory(dataPath) + assertEquals("2018-04-13T22:01:46", testSet.meta["end_time"].string) + assertEquals(ListValue.EMPTY, testSet.meta["comments"].value) + assertEquals(31, testSet.points.size) + assertEquals("2018-04-13T21:56:09", testSet.points.find { it.index == 22 }?.meta["end_time"].string) + } +} \ No newline at end of file diff --git a/numass-data-proto/src/test/resources/testData/set_4/meta b/numass-data-proto/src/test/resources/testData/set_4/meta new file mode 100644 index 0000000..60b243e Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/meta differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p0(10s)(HV1=18700) b/numass-data-proto/src/test/resources/testData/set_4/p0(10s)(HV1=18700) new file mode 100644 index 0000000..397d2f3 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p0(10s)(HV1=18700) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p1(10s)(HV1=19015) b/numass-data-proto/src/test/resources/testData/set_4/p1(10s)(HV1=19015) new file mode 100644 index 0000000..5088d9c Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p1(10s)(HV1=19015) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p10(10s)(HV1=18800) b/numass-data-proto/src/test/resources/testData/set_4/p10(10s)(HV1=18800) new file mode 100644 index 0000000..1f68fef Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p10(10s)(HV1=18800) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p11(10s)(HV1=18700) b/numass-data-proto/src/test/resources/testData/set_4/p11(10s)(HV1=18700) new file mode 100644 index 0000000..3a97abd Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p11(10s)(HV1=18700) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p12(10s)(HV1=18600) b/numass-data-proto/src/test/resources/testData/set_4/p12(10s)(HV1=18600) new file mode 100644 index 0000000..babcbe0 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p12(10s)(HV1=18600) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p13(10s)(HV1=18400) b/numass-data-proto/src/test/resources/testData/set_4/p13(10s)(HV1=18400) new file mode 100644 index 0000000..8ccfea1 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p13(10s)(HV1=18400) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p14(10s)(HV1=18200) b/numass-data-proto/src/test/resources/testData/set_4/p14(10s)(HV1=18200) new file mode 100644 index 0000000..1c7e878 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p14(10s)(HV1=18200) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p15(10s)(HV1=18000) b/numass-data-proto/src/test/resources/testData/set_4/p15(10s)(HV1=18000) new file mode 100644 index 0000000..a427578 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p15(10s)(HV1=18000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p16(10s)(HV1=17500) b/numass-data-proto/src/test/resources/testData/set_4/p16(10s)(HV1=17500) new file mode 100644 index 0000000..94edb84 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p16(10s)(HV1=17500) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p17(10s)(HV1=17000) b/numass-data-proto/src/test/resources/testData/set_4/p17(10s)(HV1=17000) new file mode 100644 index 0000000..f1cc327 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p17(10s)(HV1=17000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p18(10s)(HV1=18700) b/numass-data-proto/src/test/resources/testData/set_4/p18(10s)(HV1=18700) new file mode 100644 index 0000000..d151cf7 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p18(10s)(HV1=18700) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p19(10s)(HV1=16500) b/numass-data-proto/src/test/resources/testData/set_4/p19(10s)(HV1=16500) new file mode 100644 index 0000000..09d8209 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p19(10s)(HV1=16500) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p2(10s)(HV1=19005) b/numass-data-proto/src/test/resources/testData/set_4/p2(10s)(HV1=19005) new file mode 100644 index 0000000..29bcb91 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p2(10s)(HV1=19005) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p20(10s)(HV1=16000) b/numass-data-proto/src/test/resources/testData/set_4/p20(10s)(HV1=16000) new file mode 100644 index 0000000..544b369 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p20(10s)(HV1=16000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p21(10s)(HV1=15500) b/numass-data-proto/src/test/resources/testData/set_4/p21(10s)(HV1=15500) new file mode 100644 index 0000000..b746735 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p21(10s)(HV1=15500) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p22(10s)(HV1=15000) b/numass-data-proto/src/test/resources/testData/set_4/p22(10s)(HV1=15000) new file mode 100644 index 0000000..c251a6a Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p22(10s)(HV1=15000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p23(10s)(HV1=14500) b/numass-data-proto/src/test/resources/testData/set_4/p23(10s)(HV1=14500) new file mode 100644 index 0000000..9accae3 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p23(10s)(HV1=14500) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p24(10s)(HV1=18700) b/numass-data-proto/src/test/resources/testData/set_4/p24(10s)(HV1=18700) new file mode 100644 index 0000000..34a0f7e Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p24(10s)(HV1=18700) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p25(10s)(HV1=14000) b/numass-data-proto/src/test/resources/testData/set_4/p25(10s)(HV1=14000) new file mode 100644 index 0000000..d6afa47 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p25(10s)(HV1=14000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p26(10s)(HV1=13500) b/numass-data-proto/src/test/resources/testData/set_4/p26(10s)(HV1=13500) new file mode 100644 index 0000000..9fb4bc0 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p26(10s)(HV1=13500) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p27(10s)(HV1=13000) b/numass-data-proto/src/test/resources/testData/set_4/p27(10s)(HV1=13000) new file mode 100644 index 0000000..d3be913 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p27(10s)(HV1=13000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p28(10s)(HV1=12500) b/numass-data-proto/src/test/resources/testData/set_4/p28(10s)(HV1=12500) new file mode 100644 index 0000000..492e2af Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p28(10s)(HV1=12500) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p29(10s)(HV1=12000) b/numass-data-proto/src/test/resources/testData/set_4/p29(10s)(HV1=12000) new file mode 100644 index 0000000..acfd493 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p29(10s)(HV1=12000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p3(10s)(HV1=19000) b/numass-data-proto/src/test/resources/testData/set_4/p3(10s)(HV1=19000) new file mode 100644 index 0000000..1f5e85e Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p3(10s)(HV1=19000) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p30(10s)(HV1=18700) b/numass-data-proto/src/test/resources/testData/set_4/p30(10s)(HV1=18700) new file mode 100644 index 0000000..074306b Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p30(10s)(HV1=18700) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p4(10s)(HV1=18995) b/numass-data-proto/src/test/resources/testData/set_4/p4(10s)(HV1=18995) new file mode 100644 index 0000000..22d1dc2 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p4(10s)(HV1=18995) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p5(10s)(HV1=18990) b/numass-data-proto/src/test/resources/testData/set_4/p5(10s)(HV1=18990) new file mode 100644 index 0000000..f4bea83 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p5(10s)(HV1=18990) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p6(10s)(HV1=18700) b/numass-data-proto/src/test/resources/testData/set_4/p6(10s)(HV1=18700) new file mode 100644 index 0000000..3e771a4 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p6(10s)(HV1=18700) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p7(10s)(HV1=18980) b/numass-data-proto/src/test/resources/testData/set_4/p7(10s)(HV1=18980) new file mode 100644 index 0000000..d94af88 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p7(10s)(HV1=18980) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p8(10s)(HV1=18950) b/numass-data-proto/src/test/resources/testData/set_4/p8(10s)(HV1=18950) new file mode 100644 index 0000000..ad4a3d6 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p8(10s)(HV1=18950) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/p9(10s)(HV1=18900) b/numass-data-proto/src/test/resources/testData/set_4/p9(10s)(HV1=18900) new file mode 100644 index 0000000..448c462 Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/p9(10s)(HV1=18900) differ diff --git a/numass-data-proto/src/test/resources/testData/set_4/scenario b/numass-data-proto/src/test/resources/testData/set_4/scenario new file mode 100644 index 0000000..180b082 --- /dev/null +++ b/numass-data-proto/src/test/resources/testData/set_4/scenario @@ -0,0 +1,31 @@ +POINT 10 18700 0 +POINT 10 19015 0 +POINT 10 19005 0 +POINT 10 19000 0 +POINT 10 18995 0 +POINT 10 18990 0 +POINT 10 18700 0 +POINT 10 18980 0 +POINT 10 18950 0 +POINT 10 18900 0 +POINT 10 18800 0 +POINT 10 18700 0 +POINT 10 18600 0 +POINT 10 18400 0 +POINT 10 18200 0 +POINT 10 18000 0 +POINT 10 17500 0 +POINT 10 17000 0 +POINT 10 18700 0 +POINT 10 16500 0 +POINT 10 16000 0 +POINT 10 15500 0 +POINT 10 15000 0 +POINT 10 14500 0 +POINT 10 18700 0 +POINT 10 14000 0 +POINT 10 13500 0 +POINT 10 13000 0 +POINT 10 12500 0 +POINT 10 12000 0 +POINT 10 18700 0 diff --git a/numass-data-proto/src/test/resources/testData/set_4/voltage b/numass-data-proto/src/test/resources/testData/set_4/voltage new file mode 100644 index 0000000..d611c5a Binary files /dev/null and b/numass-data-proto/src/test/resources/testData/set_4/voltage differ