예제 #1
0
 /**
  * Retrieve the attribute at a given index.
  *
  * @param index - the index to look up.
  * @return The attribute at that index.
  */
 public Attribute get(int index) {
   return new Attribute((NbtCompound) attributes.get(index));
 }
예제 #2
0
 /**
  * Add a new attribute to the list.
  *
  * @param attribute - the new attribute.
  */
 public void add(Attribute attribute) {
   Preconditions.checkNotNull(attribute.getName(), "must specify an attribute name.");
   attributes.add(attribute.data);
 }
예제 #3
0
 public void clear() {
   attributes.clear();
 }
예제 #4
0
 /**
  * Retrieve the number of attributes.
  *
  * @return Number of attributes.
  */
 public int size() {
   return attributes.size();
 }