helix.graph.model.impl
Class RVertexSet

java.lang.Object
  extended by helix.graph.model.impl.RVertexSet
All Implemented Interfaces:
RegistryValue, Iterable<Vertex>

public class RVertexSet
extends Object
implements RegistryValue, Iterable<Vertex>

a memory implementation of RegistryValue for set of Vertices

Author:
viari

Constructor Summary
RVertexSet()
           
RVertexSet(Collection<Vertex> c)
           
RVertexSet(Vertex v)
           
 
Method Summary
 void addVertex(Vertex v)
           
 void clear()
           
 boolean equals(Object o)
           
static RVertexSet getVertexSet(Registry r, String key)
          Lookup the RVertexSet associated to key in registry and create an empty RVertexSet if it does not exist.
 int hashCode()
           
 boolean hasVertex(Vertex v)
           
 Iterator<Vertex> iterator()
           
 RegistryValue klone()
          Potentially clone this instance.
 void removeVertex(Vertex v)
           
 String serialize()
          get a String representation of this instance.
 int size()
           
 boolean toBoolean()
           
 float toFloat()
           
 int toInt()
           
 String toString()
          a human readable version of toString()
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RVertexSet

public RVertexSet()

RVertexSet

public RVertexSet(Vertex v)

RVertexSet

public RVertexSet(Collection<Vertex> c)
Method Detail

klone

public RegistryValue klone()
Description copied from interface: RegistryValue
Potentially clone this instance.

Specified by:
klone in interface RegistryValue
Returns:
a clone (deep copy) of this instance. Note that it may be the instance itself (for immutable objects).

serialize

public String serialize()
Description copied from interface: RegistryValue
get a String representation of this instance. this representation can further be used as a constructor argument to reconstruct this instance.

Specified by:
serialize in interface RegistryValue
Returns:
string representation of this instance

toBoolean

public boolean toBoolean()
                  throws IllegalValueException
Specified by:
toBoolean in interface RegistryValue
Returns:
boolean representation of this instance value
Throws:
IllegalValueException

toFloat

public float toFloat()
              throws IllegalValueException
Specified by:
toFloat in interface RegistryValue
Returns:
float representation of this instance value
Throws:
IllegalValueException

toInt

public int toInt()
          throws IllegalValueException
Specified by:
toInt in interface RegistryValue
Returns:
int representation of this instance value
Throws:
IllegalValueException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

iterator

public Iterator<Vertex> iterator()
Specified by:
iterator in interface Iterable<Vertex>

hasVertex

public boolean hasVertex(Vertex v)

addVertex

public void addVertex(Vertex v)

removeVertex

public void removeVertex(Vertex v)

clear

public void clear()

size

public int size()

toString

public String toString()
a human readable version of toString()

Specified by:
toString in interface RegistryValue
Overrides:
toString in class Object
Returns:
String representation of this instance value

getVertexSet

public static final RVertexSet getVertexSet(Registry r,
                                            String key)
Lookup the RVertexSet associated to key in registry and create an empty RVertexSet if it does not exist. This helper function is equivalent to : if (r.has(key))
return (RVertexSet) r.get(key);
else
return (RVertexSet) r.set(key, new RVertexSet());