|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelix.graph.model.impl.AbstractRegistryValue
helix.graph.model.impl.RColorSet
public class RColorSet
Implements set of colors to store into Registry
Constructor Summary | |
---|---|
RColorSet()
constructor : make an empty RColorSet |
|
RColorSet(Iterable<Integer> colors)
constructor : make a RColorSet by using a specified set of integers |
|
RColorSet(RColorSet cset)
constructor : make a RColorSet by copying another RColorSet |
|
RColorSet(String s)
constructor : make a RColorSet by parsing the binary string argument (e.g. |
Method Summary | |
---|---|
void |
andColors(RColorSet cset)
compute the intersection ('and') between this ColorSet and the ColorSet argument. |
void |
clearColor(int color)
unset color in this ColorSet same as : setColor(i, false) |
void |
clearColors()
clear all colors in this ColorSet |
int |
countColors()
count the number of colors in this ColorSet |
boolean |
equals(Object o)
|
static RColorSet |
getColors(Registry r)
same as getColors(r, Registry.Colors) |
static RColorSet |
getColors(Registry r,
String key)
Lookup the RColorSet associated to key in registry and create an empty RColorSet if it does not exist. |
boolean |
hasColor(int color)
test if this ColorSet has the specified color |
static boolean |
hasColor(Registry r,
int i)
same as hasColor(r, Registry.Colors) |
static boolean |
hasColor(Registry r,
String key,
int i)
tells if registry r has a RcolorSet on key and if this RColorSet has color i |
static boolean |
hasColors(Registry r)
same as hasColors(r, Registry.Colors) |
static boolean |
hasColors(Registry r,
String key)
tells if registry r has a RcolorSet on key and if this RcolorSet is not empty |
int |
hashCode()
|
boolean |
includeColors(RColorSet cset)
tell if this ColorSet includes all colors in the ColorSet argument. |
boolean |
intersectColor(RColorSet cset)
tell if this ColorSet intersects the ColorSet argument i.e. |
boolean |
isEmpty()
tell if this ColorSet is empty same as (cset.countColors == 0) |
Iterator<Integer> |
iterator()
return an iterable over colors |
RegistryValue |
klone()
Potentially clone this instance. |
int |
length()
get the "logical size" of this ColorSet : the highest color of the set plus one. |
int |
maxColor()
return highest color in this colorSet (or -1 if colorSet is empty) |
int |
minColor()
return lowest color in this colorSet (or -1 if colorSet is empty) |
static int |
nbColors(Registry r)
same as nbColors(r, Registry.Colors) |
static int |
nbColors(Registry r,
String key)
get the number of colors in RColorSet associated o key in registry r. |
void |
orColors(RColorSet cset)
compute the union ('or') between this ColorSet and the ColorSet argument. |
void |
setColor(int color)
set color in this ColorSet same as : setColor(i, true) |
void |
setColor(int color,
boolean b)
set/unset color in this ColorSet |
void |
setColors(RColorSet cset)
set all colors in this ColorSet at same values as in argument same as this.clearColors(); this.orColors(cset); |
void |
shift(int shift)
shift bits to left or right in this ColorSet by specified amount. |
int |
singleColor()
if this ColorSet has a single color return this color else throws an IllegalValueException |
String |
toString()
Get a String representation of this instance value note: this representation may not be suitable as the constructor argument, use serialize() instead. |
void |
xorColors(RColorSet cset)
compute the 'xor' between this ColorSet and the ColorSet argument. |
Methods inherited from class helix.graph.model.impl.AbstractRegistryValue |
---|
serialize, toBoolean, toFloat, toInt |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RColorSet()
public RColorSet(String s) throws IllegalValueException
IllegalValueException
public RColorSet(RColorSet cset)
public RColorSet(Iterable<Integer> colors)
Method Detail |
---|
public RegistryValue klone()
RegistryValue
klone
in interface RegistryValue
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
RegistryValue
toString
in interface RegistryValue
toString
in class Object
public Iterator<Integer> iterator()
iterator
in interface Iterable<Integer>
public boolean hasColor(int color)
public void setColor(int color, boolean b)
public void setColor(int color)
public void clearColor(int color)
public void clearColors()
public void setColors(RColorSet cset)
this.clearColors(); this.orColors(cset);
public void andColors(RColorSet cset)
public void orColors(RColorSet cset)
public void xorColors(RColorSet cset)
public void shift(int shift)
public int countColors()
public int minColor()
public int maxColor()
public int length()
public boolean isEmpty()
public boolean includeColors(RColorSet cset)
public boolean intersectColor(RColorSet cset)
public int singleColor() throws IllegalValueException
IllegalValueException
public static final RColorSet getColors(Registry r, String key)
if (r.has(key))
return (RColorSet) r.get(key);
else
return (RColorSet) r.set(key, new RColorSet());
public static final RColorSet getColors(Registry r)
public static final boolean hasColors(Registry r, String key)
public static final boolean hasColors(Registry r)
public static final boolean hasColor(Registry r, String key, int i)
public static final boolean hasColor(Registry r, int i)
public static final int nbColors(Registry r, String key)
public static final int nbColors(Registry r)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |