step.grid.reports.TokenGroupCapacity Maven / Gradle / Ivy
The newest version!
/*******************************************************************************
* Copyright (C) 2020, exense GmbH
*
* This file is part of STEP
*
* STEP is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* STEP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with STEP. If not, see .
******************************************************************************/
package step.grid.reports;
import java.util.HashMap;
import java.util.Map;
import step.grid.TokenWrapperState;
@Deprecated
public class TokenGroupCapacity {
Map key;
Map countByState = new HashMap<>();
int capacity = 0;
public TokenGroupCapacity(Map key) {
super();
this.key = key;
}
public void incrementCapacity() {
capacity++;
}
public void incrementUsage(TokenWrapperState state) {
if(!countByState.containsKey(state)) {
countByState.put(state, 1);
} else {
countByState.put(state, countByState.get(state)+1);
}
}
public Map getKey() {
return key;
}
public int getCapacity() {
return capacity;
}
public void setCountByState(Map countByState) {
this.countByState = countByState;
}
public Map getCountByState() {
return countByState;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy