| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- package com.example.data_structure.vo;
- import org.springframework.stereotype.Component;
- import java.util.ArrayList;
- @Component
- public class QuickStep {
- private String type; //有六个值: beforeSelectPivot,onSelectPivot,onCompare,onExchange,onConfirm,allSorted
- private ArrayList<Bar> content;
- public QuickStep(String type, ArrayList<Bar> content) {
- this.type = type;
- this.content = content;
- }
- public QuickStep() {
- }
- //getter
- public String getType() {
- return type;
- }
- public ArrayList<Bar> getContent() {
- return content;
- }
- //setter
- public void setType(String type) {
- this.type = type;
- }
- public void setContent(ArrayList<Bar> content) {
- this.content = content;
- }
- //toString
- @Override
- public String toString() {
- return "QuickStep{" +
- "type='" + type + '\'' +
- ", content=" + content +
- '}';
- }
- //copy
- public static ArrayList<Bar> copyContent(ArrayList<Bar> content){
- ArrayList<Bar> copyContent=new ArrayList<Bar>();
- for(int i=0;i<content.size();i++){
- Bar bar=Bar.copyBar(content.get(i));
- copyContent.add(bar);
- }
- return copyContent;
- }
- public String toColorString(){
- String re=type+" ";
- for(int i=0;i<content.size();i++){
- re=re+content.get(i).toColorString();
- }
- re=re+"\n";
- return re;
- }
- }
|