All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.iris.dmc.seed.control.station.B060 Maven / Gradle / Ivy

The newest version!
package edu.iris.dmc.seed.control.station;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import edu.iris.dmc.io.SeedStringBuilder;
import edu.iris.dmc.seed.Blockette;


public class B060 extends AbstractResponseBlockette{

	private List stages = new ArrayList();

	public B060() {
		super(60, "Response Reference Blockette");

	}

	public List getStages() {
		return stages;
	}

	public void setStages(List stages) {
		this.stages = stages;
	}

	public void add(Stage stage) {
		this.stages.add(stage);
	}

	@Override
	public String toSeedString() {

		SeedStringBuilder builder = new SeedStringBuilder("0" + this.getType() + "####");

		builder.append(this.getStages().size(), 2);
		for (Stage stage : this.getStages()) {
			builder.append(stage.getSequence(), 2);
			builder.append(stage.getResponses().size(), 2);
			for (Integer lookup : stage.getResponses()) {
				builder.append(lookup, 4);
			}
		}

		builder.replace(3, 7, builder.length(), "####");
		return builder.toString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy