de.grogra.rgg
Class LongSynth<T>

java.lang.Object
  extended by de.grogra.rgg.LongSynth<T>
Type Parameters:
T - the type of objects for which synthesized attributes are computed
All Implemented Interfaces:
VoidToLongGenerator

public final class LongSynth<T>
extends java.lang.Object
implements VoidToLongGenerator

Instances of LongSynth are used in the context of the method Library.synthesize(Object, ObjectToObjectGenerator, ObjectToLong). and represent the information needed for the computation of a synthesized attribute: object is the current object for which the synthesized attribute has to be computed, the generator method evaluateLong yields the values of the synthesized attributes of object's descendants.

Author:
Ole Kniemeyer

Field Summary
 T object
          The current object.
 
Constructor Summary
LongSynth()
           
 
Method Summary
 void evaluateLong(LongConsumer cons)
          This generator method yields the values of the synthesized attribute for every descendant of object.
 long get(int index)
           
 int size()
           
 void values(LongConsumer cons)
          This method is an alias for evaluateLong(de.grogra.xl.lang.LongConsumer).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

public T object
The current object.

Constructor Detail

LongSynth

public LongSynth()
Method Detail

evaluateLong

public void evaluateLong(LongConsumer cons)
This generator method yields the values of the synthesized attribute for every descendant of object. These values have been computed previously.

Specified by:
evaluateLong in interface VoidToLongGenerator
Parameters:
cons - the consumer which receives the values of synthesized attribute of descendants

get

public long get(int index)

size

public int size()

values

public void values(LongConsumer cons)
This method is an alias for evaluateLong(de.grogra.xl.lang.LongConsumer).