de.upb.hni.vmagic.util
Class VhdlCollections

java.lang.Object
  extended by de.upb.hni.vmagic.util.VhdlCollections

public class VhdlCollections
extends java.lang.Object

Vhdl collection utility class.


Method Summary
static
<E extends DeclarativeItemMarker>
ResolvableList<E>
createDeclarationList()
          Creates a declaration list.
static
<E extends DeclarativeItemMarker>
ResolvableList<E>
createDeclarationList(java.util.List<E> list)
          Creates a declaration list.
static
<E extends LabeledElement>
ResolvableList<E>
createLabeledElementList(DeclarativeRegion parent)
          Creates a list of labeled elements.
static
<E extends LabeledElement>
ResolvableList<E>
createLabeledElementList(DeclarativeRegion parent, java.util.List<E> list)
          Creates a list of labeled elements.
static
<E extends VhdlElement>
ResolvableList<E>
createNamedEntityList(DeclarativeRegion parent)
          Creates a list of named entities.
static
<E extends VhdlElement>
ResolvableList<E>
createNamedEntityList(DeclarativeRegion parent, java.util.List<E> list)
          Creates a list of named entities.
static
<E extends VhdlObjectProvider<? extends VhdlObject>>
ResolvableList<E>
createVhdlObjectList()
          Creates a list of VHDL objects.
static
<E extends VhdlObjectProvider<? extends VhdlObject>>
ResolvableList<E>
createVhdlObjectList(java.util.List<E> list)
          Creates a list of VHDL objects.
static
<T,E> java.util.List<T>
getAll(java.util.List<E> list, java.lang.Class<T> clazz)
          Returns a list that contains all elements in another list which are instances of the given class.
static
<T extends NamedEntity,E>
T
getByIdentifier(java.util.List<E> list, java.lang.Class<T> clazz, java.lang.String identifier)
          Returns an element by it's identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAll

public static <T,E> java.util.List<T> getAll(java.util.List<E> list,
                                             java.lang.Class<T> clazz)
Returns a list that contains all elements in another list which are instances of the given class.

Type Parameters:
T - the type of the elements that should be returned
E - the type of the elements in the original list
Parameters:
list - the original list
clazz - the type of the elements that should be returned
Returns:
a list

getByIdentifier

public static <T extends NamedEntity,E> T getByIdentifier(java.util.List<E> list,
                                                          java.lang.Class<T> clazz,
                                                          java.lang.String identifier)
Returns an element by it's identifier.

Type Parameters:
T - the searched type
E - the list element type
Parameters:
list - the list
clazz - the searched type
identifier - the identifier
Returns:
the object or null if no matching element exists

createDeclarationList

public static <E extends DeclarativeItemMarker> ResolvableList<E> createDeclarationList()
Creates a declaration list.

Type Parameters:
E - the element type
Returns:
the list

createDeclarationList

public static <E extends DeclarativeItemMarker> ResolvableList<E> createDeclarationList(java.util.List<E> list)
Creates a declaration list.

Type Parameters:
E - the element type
Parameters:
list - a list that is used to initialize the list
Returns:
the list

createVhdlObjectList

public static <E extends VhdlObjectProvider<? extends VhdlObject>> ResolvableList<E> createVhdlObjectList()
Creates a list of VHDL objects.

Type Parameters:
E - the element type
Returns:
the list

createVhdlObjectList

public static <E extends VhdlObjectProvider<? extends VhdlObject>> ResolvableList<E> createVhdlObjectList(java.util.List<E> list)
Creates a list of VHDL objects.

Type Parameters:
E - the element type
Parameters:
list - a list that is used to initialize the list
Returns:
the list

createLabeledElementList

public static <E extends LabeledElement> ResolvableList<E> createLabeledElementList(DeclarativeRegion parent)
Creates a list of labeled elements.

Type Parameters:
E - the element type
Parameters:
parent - the parent
Returns:
the list

createLabeledElementList

public static <E extends LabeledElement> ResolvableList<E> createLabeledElementList(DeclarativeRegion parent,
                                                                                    java.util.List<E> list)
Creates a list of labeled elements.

Type Parameters:
E - the element type
Parameters:
parent - the parent
list - a list that is used to initialize the list
Returns:
the list

createNamedEntityList

public static <E extends VhdlElement> ResolvableList<E> createNamedEntityList(DeclarativeRegion parent)
Creates a list of named entities.

Type Parameters:
E - the element type
Parameters:
parent - the parent
Returns:
the list

createNamedEntityList

public static <E extends VhdlElement> ResolvableList<E> createNamedEntityList(DeclarativeRegion parent,
                                                                              java.util.List<E> list)
Creates a list of named entities.

Type Parameters:
E - the element type
Parameters:
parent - the parent
list - a list that is used to initialize the list
Returns:
the list