MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / PatternResult

Class PatternResult

The 5zig Mod/src/eu/the5zig/mod/server/PatternResult.java:11–43  ·  view source on GitHub ↗

Created by 5zig. All rights reserved © 2015 Class for Pattern Matching Result, used in ServerListener to avoid IndexArrayOutOfBoundsException.

Source from the content-addressed store, hash-verified

9 * Class for Pattern Matching Result, used in ServerListener to avoid IndexArrayOutOfBoundsException.
10 */
11public class PatternResult implements IPatternResult {
12
13 private final List<String> result;
14 private boolean ignoreMessage = false;
15
16 public PatternResult(List<String> result) {
17 this.result = result;
18 }
19
20 public int size() {
21 return result.size();
22 }
23
24 public String get(int index) {
25 if (index < 0 || index >= size())
26 return "";
27 return result.get(index);
28 }
29
30 @Override
31 public void ignoreMessage(boolean ignore) {
32 this.ignoreMessage = ignore;
33 }
34
35 boolean shouldMessageBeIgnored() {
36 return ignoreMessage;
37 }
38
39 @Override
40 public String toString() {
41 return result.toString();
42 }
43}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected