Package edu.neu.ccs.demeterf.lib

DemFGen useful library classes.


Class Summary
BLACK Represents the color Black for RBTrees
Cons<X> Represents a Lisp style cons list.
Empty<X> Represents the Empty List.
Entry<Key,Val> Class representing Map Entries (key/value Pairs).
Entry.key Field Class for key
Entry.val Field Class for val
ident DemFGen identifier class.  
List<X> Represents Lisp stype Lists.
List.Build<X> Build a List from the sequence of integers [0..len-1]
List.Comp<X> Compare two List Elements of the same type
List.Fold<X,Y> Fold the List into a single Value
List.GComp<X,Y> (General) Compare two List Elements of possibly different types (true is "LessThan" for sort(), but "Equal" for same(...))
List.Map<X,Y> Apply a function to each element of the list
List.Pred<X> Select Elements of a List
List.Stringer<X> Compute a String from a List (Visitor)
List.Zip<X,Y,Z> Zip two Lists into a single Value
Map<Key,Val> Represents a Map of comparable Keys to any old Values, implemented with RBTrees.
Map.Merge<Val> Function Class to help in the merging of Maps.
Map.Transform<X,Y> Trnasformer for Values o fa given Map
Map.tree Field Class
None<X> Represents Nothing...
Option<X> Represents an Optional instance, similar to ML/Haskell Option types.
RBColor Represents the Color of an RBTree
RBLeaf<X extends Comparable<X>> Represents the Leaf of an RBTree, e.g., the empty tree
RBNode<X extends Comparable<X>> Represents a Node of an RBTree, e.g., the non-empty tree
RBTree<X extends Comparable<X>> Java Functional implementation of Red-Black Trees.
RED Represents the color Red for RBTrees
Set<X> Represents a Set of comparable Elements, implemented with RBTrees.
Set.Merge<X> Function Class to help in the merging of Sets.
Set.tree Field Class
Some<X> Represents an Optional instance that exists.
verbatim Represents verbatim text, similar to DemeterJ Text class.
Wrap<X> Wrapping class for Sets, so that the elements are not forced to be Comparable.

Exception Summary
RE Simple Runtime Exception for the DemeterF Lib

Package edu.neu.ccs.demeterf.lib Description

DemFGen useful library classes. These classes can be imported and used with DemFGen as collection classes. The file "" contains the DemFGen CD file that represents the structure of these classes. It can be included in projects to allow parsing/printing of these classes for use in your own CD files.

Here's the library structures from

    package edu.neu.ccs.demeterf.demfgen.lib;

    import edu.neu.ccs.demeterf.demfgen.lib.*;

    nogen List(X) = Cons(X) | Empty(X).
    nogen Cons(X) =  X  List(X).
    nogen Empty(X) = .
    nogen Option(X)= Some(X) | None(X).
    nogen Some(X)  =  X.
    nogen None(X)  = .
    nogen RBColor = RED | BLACK.
    nogen RED = "red".
    nogen BLACK = "black".
    nogen RBTree(X:Comparable) = RBNode(X) | RBLeaf(X).
    nogen RBNode(X:Comparable) = "(node"  RBColor   X
                                          RBTree(X) ")".
    nogen RBLeaf(X:Comparable) = .

Each class also contains tons of useful methods that will help make your life easier... and it's all done functionally :)