public class Attributes extends Object implements Iterable<Attribute>, Comparator<Attribute>, Comparable<Attributes>
Constructor and Description |
---|
Attributes() |
Modifier and Type | Method and Description |
---|---|
int |
attributesHash() |
void |
clear()
Removes all attributes
|
int |
compare(Attribute arg0,
Attribute arg1)
Used for sorting attributes by type (not by value)
|
int |
compareTo(Attributes other) |
boolean |
equals(Object other) |
Array<Attribute> |
get(Array<Attribute> out,
long type)
Get multiple attributes at once.
|
<T extends Attribute> |
get(Class<T> clazz,
long type)
Example usage: ((BlendingAttribute)material.get(BlendingAttribute.ID)).sourceFunction;
|
Attribute |
get(long type)
Example usage: ((BlendingAttribute)material.get(BlendingAttribute.ID)).sourceFunction;
|
long |
getMask() |
boolean |
has(long type) |
int |
hashCode() |
Iterator<Attribute> |
iterator()
Used for iterating through the attributes
|
void |
remove(long mask)
Removes the attribute from the material, i.e.: material.remove(BlendingAttribute.ID); Can also be used to remove multiple
attributes also, i.e.
|
boolean |
same(Attributes other)
|
boolean |
same(Attributes other,
boolean compareValues)
Check if this collection has the same attributes as the other collection.
|
void |
set(Attribute... attributes)
Add an array of attributes to this material.
|
void |
set(Attribute attribute)
Add a attribute to this material.
|
void |
set(Attribute attribute1,
Attribute attribute2)
Add multiple attributes to this material.
|
void |
set(Attribute attribute1,
Attribute attribute2,
Attribute attribute3)
Add multiple attributes to this material.
|
void |
set(Attribute attribute1,
Attribute attribute2,
Attribute attribute3,
Attribute attribute4)
Add multiple attributes to this material.
|
void |
set(Iterable<Attribute> attributes)
Add an array of attributes to this material.
|
int |
size() |
void |
sort()
Sort the attributes by their ID
|
public final void sort()
public final long getMask()
public final Attribute get(long type)
public final <T extends Attribute> T get(Class<T> clazz, long type)
public final Array<Attribute> get(Array<Attribute> out, long type)
public void clear()
public int size()
public final void set(Attribute attribute)
public final void set(Attribute attribute1, Attribute attribute2)
public final void set(Attribute attribute1, Attribute attribute2, Attribute attribute3)
public final void set(Attribute attribute1, Attribute attribute2, Attribute attribute3, Attribute attribute4)
public final void set(Attribute... attributes)
public final void set(Iterable<Attribute> attributes)
public final void remove(long mask)
public final boolean has(long type)
public final boolean same(Attributes other, boolean compareValues)
compareValues
- True to compare attribute values, false to only compare attribute typespublic final boolean same(Attributes other)
public final int compare(Attribute arg0, Attribute arg1)
compare
in interface Comparator<Attribute>
public int attributesHash()
hashCode()
because the latter
might include other properties as well, i.e. the material id.public boolean equals(Object other)
equals
in interface Comparator<Attribute>
equals
in class Object
public int compareTo(Attributes other)
compareTo
in interface Comparable<Attributes>
Copyright © 2015. All rights reserved.