|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.common.ResourceCount
public class ResourceCount
ResourceCount is a utility class used to count reservations in
a ReservationSet based on the reservation state and resource type. An
instance of this class is used as an argument to the "tally" methods in
ReservationSet.
Note: no internal locking.
ReservationSet| Nested Class Summary | |
|---|---|
protected class |
ResourceCount.CountsPerType
Inner class representing counts for a given resource type. |
| Field Summary | |
|---|---|
protected java.util.HashMap<java.lang.String,ResourceCount.CountsPerType> |
map
Counts per resource type. |
| Constructor Summary | |
|---|---|
ResourceCount()
Creates a new instance. |
|
| Method Summary | |
|---|---|
long |
countActive(ResourceType type)
Returns the number of active units from the given resource type. |
long |
countClose(ResourceType type)
Returns the number of closed units from the given resource type. |
long |
countExpired(ResourceType type)
Returns the number of expired units from the given resource type. |
long |
countFailed(ResourceType type)
Returns the number of failed units from the given resource type. |
long |
countPending(ResourceType type)
Returns the number of pending units from the given resource type. |
protected ResourceCount.CountsPerType |
getCounts(ResourceType type)
Returns the count entry for the given resource type. |
protected ResourceCount.CountsPerType |
getOrCreateCounts(ResourceType type)
Returns or creates a new count entry for the given resource type. |
void |
tallyActive(ResourceType type,
long count)
Increments with count the internal counter for active
units of the specified type. |
void |
tallyClose(ResourceType type,
long count)
Increments with count the internal counter for closed
units of the specified type. |
void |
tallyExpired(ResourceType type,
long count)
Increments with count the internal counter for expired
units of the specified type. |
void |
tallyFailed(ResourceType type,
long count)
Increments with count the internal counter for failed
units of the specified type. |
void |
tallyPending(ResourceType type,
long count)
Increments with count the internal counter for pending
units of the specified type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.HashMap<java.lang.String,ResourceCount.CountsPerType> map
| Constructor Detail |
|---|
public ResourceCount()
| Method Detail |
|---|
protected ResourceCount.CountsPerType getCounts(ResourceType type)
type - resource type
protected ResourceCount.CountsPerType getOrCreateCounts(ResourceType type)
type - resource type
public long countActive(ResourceType type)
type - resource type
public long countPending(ResourceType type)
type - resource type
public long countExpired(ResourceType type)
type - resource type
public long countFailed(ResourceType type)
type - resource type
public long countClose(ResourceType type)
type - resource type
public void tallyActive(ResourceType type,
long count)
count the internal counter for active
units of the specified type.
type - resource type
public void tallyPending(ResourceType type,
long count)
count the internal counter for pending
units of the specified type.
type - resource type
public void tallyExpired(ResourceType type,
long count)
count the internal counter for expired
units of the specified type.
type - resource type
public void tallyFailed(ResourceType type,
long count)
count the internal counter for failed
units of the specified type.
type - resource type
public void tallyClose(ResourceType type,
long count)
count the internal counter for closed
units of the specified type.
type - resource type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||