@Beta
public class LabelResourcePool
extends java.lang.Object
Constructor and Description |
---|
LabelResourcePool(java.lang.String deviceId,
long beginLabel,
long endLabel)
Creates a pool by device id,begin label id,end label id.
|
LabelResourcePool(java.lang.String deviceId,
long beginLabel,
long endLabel,
long totalNum,
long usedNum,
long currentUsedMaxLabelId,
com.google.common.collect.ImmutableSet<LabelResource> releaseLabelId)
Creates a pool by device id,begin label id,end label id.
|
Modifier and Type | Method and Description |
---|---|
LabelResourceId |
beginLabel()
Returns a begin Label id.
|
LabelResourceId |
currentUsedMaxLabelId()
Returns a begin Label id.
|
DeviceId |
deviceId()
Returns a device id.
|
LabelResourceId |
endLabel()
Returns an end Label id.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.util.Set<LabelResource> |
releaseLabelId()
Returns the Set of released label before.
|
java.lang.String |
toString() |
long |
totalNum()
Returns total number.
|
long |
usedNum()
Returns used number.
|
public LabelResourcePool(java.lang.String deviceId, long beginLabel, long endLabel)
deviceId
- device identifierbeginLabel
- represents for the first label id in the range of label
resource poolendLabel
- represents for the last label id in the range of label
resource poolpublic LabelResourcePool(java.lang.String deviceId, long beginLabel, long endLabel, long totalNum, long usedNum, long currentUsedMaxLabelId, com.google.common.collect.ImmutableSet<LabelResource> releaseLabelId)
deviceId
- device identifierbeginLabel
- represents for the first label id in the range of label
resource poolendLabel
- represents for the last label id in the range of label
resource pooltotalNum
- capacity of label resource poolusedNum
- have used label numbercurrentUsedMaxLabelId
- the maximal label number idreleaseLabelId
- Set of released labelpublic DeviceId deviceId()
public LabelResourceId beginLabel()
public LabelResourceId endLabel()
public LabelResourceId currentUsedMaxLabelId()
public long totalNum()
public long usedNum()
public java.util.Set<LabelResource> releaseLabelId()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object