2021-01-02 16:15:27 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2012 IT Just working.
|
2021-01-09 12:43:02 +01:00
|
|
|
* Copyright (c) 2020 MINRES Technologies GmbH
|
2021-01-02 16:15:27 +01:00
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* IT Just working - initial API and implementation
|
|
|
|
*******************************************************************************/
|
|
|
|
package com.minres.scviewer.database.text;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import com.minres.scviewer.database.IWaveform;
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* The Class TxGenerator.
|
|
|
|
*/
|
2021-01-14 23:55:47 +01:00
|
|
|
class TxGenerator extends AbstractTxStream {
|
2021-01-02 16:15:27 +01:00
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/** The stream. */
|
2021-01-09 10:34:22 +01:00
|
|
|
TxStream stream;
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/** The begin attrs. */
|
2021-01-03 17:44:52 +01:00
|
|
|
List<TxAttributeType> beginAttrs = new ArrayList<>();
|
2021-01-02 16:15:27 +01:00
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/** The end attrs. */
|
|
|
|
List<TxAttributeType> endAttrs = new ArrayList<>();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instantiates a new tx generator.
|
|
|
|
*
|
|
|
|
* @param loader the loader
|
|
|
|
* @param id the id
|
|
|
|
* @param name the name
|
|
|
|
* @param stream the stream
|
|
|
|
*/
|
|
|
|
TxGenerator(TextDbLoader loader, Long id, String name, TxStream stream) {
|
2021-01-09 10:34:22 +01:00
|
|
|
super(loader, id, name);
|
2021-01-09 12:43:02 +01:00
|
|
|
this.stream = stream;
|
|
|
|
stream.addChild(this);
|
2021-01-02 16:15:27 +01:00
|
|
|
}
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if is same.
|
|
|
|
*
|
|
|
|
* @param other the other
|
|
|
|
* @return true, if is same
|
|
|
|
*/
|
2021-01-02 16:15:27 +01:00
|
|
|
@Override
|
2021-01-09 10:34:22 +01:00
|
|
|
public boolean isSame(IWaveform other) {
|
2021-02-27 14:59:00 +01:00
|
|
|
return (other instanceof TxGenerator && this.getId()==other.getId());
|
2021-01-02 16:15:27 +01:00
|
|
|
}
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the begin attrs.
|
|
|
|
*
|
|
|
|
* @return the begin attrs
|
|
|
|
*/
|
2021-01-03 14:16:56 +01:00
|
|
|
public List<TxAttributeType> getBeginAttrs() {
|
2021-01-02 16:15:27 +01:00
|
|
|
return beginAttrs;
|
|
|
|
}
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Gets the end attrs.
|
|
|
|
*
|
|
|
|
* @return the end attrs
|
|
|
|
*/
|
2021-01-03 14:16:56 +01:00
|
|
|
public List<TxAttributeType> getEndAttrs() {
|
2021-01-02 16:15:27 +01:00
|
|
|
return endAttrs;
|
|
|
|
}
|
2021-01-03 14:16:56 +01:00
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Gets the kind.
|
|
|
|
*
|
|
|
|
* @return the kind
|
|
|
|
*/
|
2021-01-09 10:34:22 +01:00
|
|
|
@Override
|
|
|
|
public String getKind() {
|
|
|
|
return stream.getKind();
|
|
|
|
}
|
2021-03-02 19:32:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the full hierarchical name.
|
|
|
|
*
|
|
|
|
* @return the full name
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public String getFullName() {
|
|
|
|
return ((AbstractTxStream)parent).getFullName()+"."+name;
|
|
|
|
}
|
2021-01-09 12:43:02 +01:00
|
|
|
|
2021-01-02 16:15:27 +01:00
|
|
|
}
|