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

Method getContainedByIndex

code/src/java/pcgen/core/Equipment.java:5303–5317  ·  view source on GitHub ↗

@param index integer indicating which object (contained in this object) to return @return the equipment object contained at this position.

(final int index)

Source from the content-addressed store, hash-verified

5301 * @return the equipment object contained at this position.
5302 */
5303 public Equipment getContainedByIndex(final int index)
5304 {
5305
5306 final List<Equipment> contents = new ArrayList<>(getContents());
5307
5308 if (!contents.isEmpty())
5309 {
5310 if (index <= contents.size())
5311 {
5312 return contents.get(index);
5313 }
5314 }
5315
5316 return null;
5317 }
5318
5319 /**
5320 * Get a piece of contained equipment

Callers 1

getContentsTokenMethod · 0.80

Calls 4

getContentsMethod · 0.95
isEmptyMethod · 0.65
sizeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected