public class ResourceCounter extends Object
ResourceCounter contains a set of ResourceProfiles
and their
associated counts. The counts are always positive (> 0).
Modifier and Type | Field and Description |
---|---|
static ResourceCounter |
EMPTY |
Constructor and Description |
---|
ResourceCounter() |
ResourceCounter(Map<ResourceProfile,Integer> resources) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
ResourceCounter |
copy() |
void |
decrementCount(ResourceProfile profile,
int decrement) |
int |
getResourceCount() |
int |
getResourceCount(ResourceProfile profile) |
Set<ResourceProfile> |
getResourceProfiles() |
Map<ResourceProfile,Integer> |
getResourceProfilesWithCount() |
void |
incrementCount(ResourceProfile profile,
int increment) |
boolean |
isEmpty() |
public static final ResourceCounter EMPTY
public ResourceCounter()
public ResourceCounter(Map<ResourceProfile,Integer> resources)
public void incrementCount(ResourceProfile profile, int increment)
public void decrementCount(ResourceProfile profile, int decrement)
public Map<ResourceProfile,Integer> getResourceProfilesWithCount()
public Set<ResourceProfile> getResourceProfiles()
public int getResourceCount(ResourceProfile profile)
public int getResourceCount()
public ResourceCounter copy()
public boolean isEmpty()
public void clear()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.