SCViewer/plugins/com.minres.scviewer.databas.../src/com/minres/scviewer/database/text/TxStream.java

95 lines
1.9 KiB
Java
Raw Normal View History

/*******************************************************************************
* Copyright (c) 2012 IT Just working.
* Copyright (c) 2020 MINRES Technologies GmbH
* 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 com.minres.scviewer.database.IWaveform;
/**
* The Class TxStream.
*/
2021-01-09 10:34:22 +01:00
class TxStream extends AbstractTxStream {
/** The kind. */
2021-01-08 20:50:24 +01:00
final String kind;
/**
* Instantiates a new tx stream.
*
* @param loader the loader
* @param id the id
* @param name the name
* @param kind the kind
*/
TxStream(TextDbLoader loader, Long id, String name, String kind) {
2021-01-09 10:34:22 +01:00
super(loader, id, name);
this.kind = kind;
}
/**
* Checks if is same.
*
* @param other the other
* @return true, if is same
*/
@Override
public boolean isSame(IWaveform other) {
return (other instanceof TxStream && this.getId().equals(other.getId()));
}
/**
* Gets the kind.
*
* @return the kind
*/
@Override
2021-01-09 10:34:22 +01:00
public String getKind() {
return kind;
}
/** The max concurrency. */
private int maxConcurrency = 0;
/** The concurrency. */
private int concurrency = 0;
/**
* Sets the concurrency.
*
* @param concurrency the new concurrency
*/
void setConcurrency(int concurrency) {
this.concurrency = concurrency;
if (concurrency > maxConcurrency)
maxConcurrency = concurrency;
}
/**
* Gets the concurrency.
*
* @return the concurrency
*/
int getConcurrency() {
return this.concurrency;
}
/**
* Gets the width.
*
* @return the width
*/
@Override
public int getWidth() {
return maxConcurrency;
}
}