MCPcopy Create free account
hub / github.com/PCGen/pcgen / getEquipmentHead

Method getEquipmentHead

code/src/java/pcgen/core/Equipment.java:5542–5572  ·  view source on GitHub ↗
(int index)

Source from the content-addressed store, hash-verified

5540 private List<EquipmentHead> heads = new ArrayList<>();
5541
5542 public EquipmentHead getEquipmentHead(int index)
5543 {
5544 if (index <= 0)
5545 {
5546 throw new IndexOutOfBoundsException(Integer.toString(index));
5547 }
5548
5549 int headsIndex = index - 1;
5550 int currentSize = heads.size();
5551
5552 EquipmentHead head;
5553 if (headsIndex >= currentSize)
5554 {
5555 for (int i = 0; i < headsIndex - currentSize; i++)
5556 {
5557 heads.add(null);
5558 }
5559 head = new EquipmentHead(this, index);
5560 heads.add(head);
5561 }
5562 else
5563 {
5564 head = heads.get(headsIndex);
5565 if (head == null)
5566 {
5567 head = new EquipmentHead(this, index);
5568 heads.set(headsIndex, head);
5569 }
5570 }
5571 return head;
5572 }
5573
5574 public EquipmentHead getEquipmentHeadReference(int index)
5575 {

Callers 15

getSourceObjectMethod · 0.95
getExpandedWeaponsMethod · 0.95
getEqModifierListMethod · 0.95
addToEqModifierListMethod · 0.95
addEqModifierMethod · 0.95
cloneMethod · 0.95
removeEqModifierMethod · 0.95
resizeItemMethod · 0.95
setDefaultCritMethod · 0.95
typeListMethod · 0.95
getDamageMethod · 0.95

Calls 5

toStringMethod · 0.65
sizeMethod · 0.65
addMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by 6

getSourceObjectMethod · 0.76
testResizeItemMethod · 0.64
setUpMethod · 0.64
getUnparseTargetMethod · 0.64
getUnparseTargetMethod · 0.64
getUnparseTargetMethod · 0.64