com.kotcrab.vis.usl.lang.GroupIdentifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vis-usl Show documentation
Show all versions of vis-usl Show documentation
UI styling language for scene2d.ui
package com.kotcrab.vis.usl.lang;
import com.kotcrab.vis.usl.CollectionUtils;
import java.util.ArrayList;
/** Represents group identifier of USL lang */
public class GroupIdentifier extends Identifier {
public ArrayList inherits = new ArrayList();
public ArrayList content = new ArrayList();
public GroupIdentifier () {
}
public GroupIdentifier (GroupIdentifier other) {
super(other);
this.inherits = new ArrayList(other.inherits);
for (Identifier id : other.content) {
if (id instanceof BasicIdentifier)
this.content.add(new BasicIdentifier((BasicIdentifier) id));
if (id instanceof GroupIdentifier)
this.content.add(new GroupIdentifier((GroupIdentifier) id));
}
}
@Override
public boolean equals (Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GroupIdentifier that = (GroupIdentifier) o;
if (!CollectionUtils.isEqualCollection(inherits, that.inherits)) return false;
return CollectionUtils.isEqualCollection(content, that.content);
}
@Override
public int hashCode () {
int result = super.hashCode();
result = 31 * result + inherits.hashCode();
result = 31 * result + content.hashCode();
return result;
}
}