Top Inners Fields Constructors Methods
org.glassfish.pfl.dynamic.codegen.impl

public Class ImportListImpl

extends Object
implements ImportList
Class Inheritance
All Implemented Interfaces
org.glassfish.pfl.dynamic.codegen.spi.ImportList
Imports
java.util.ArrayList, .Collections, .HashMap, .List, .Map, org.glassfish.pfl.basic.contain.Pair, org.glassfish.pfl.basic.func.UnaryVoidFunction, org.glassfish.pfl.dynamic.codegen.spi.ImportList, .Type

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract static class

Field Summary

Modifier and TypeField and Description
private Map<String, Type>
private ImportListImpl.Node
private List<Pair<String, String>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Type
addImport(final String name)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.addImport.

Add a fully-qualified type name to the imports.

public void
private void
public boolean
contains(final String name)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.contains.

Return whether or not this Type is in the imports.

public boolean
public ImportList
copy()

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.copy.

Return a copy of this ImportList.

public List<Pair<String, String>>
getInOrderList()

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.getInOrderList.

Return a list of imports as (packageName,className) pairs.

private void
insertType(final Type type)

public Type
lookup(final String className)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.lookup.

Lookup just the className, without package name.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

importsback to summary
private Map<String, Type> imports
rootback to summary
private ImportListImpl.Node root
sortedImportsback to summary
private List<Pair<String, String>> sortedImports

Constructor Detail

ImportListImplback to summary
public ImportListImpl()

Method Detail

addImportback to summary
public Type addImport(final String name)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.addImport.

Add a fully-qualified type name to the imports. Returns the Type for the name.

addImportback to summary
public void addImport(final Type type)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.addImport.

clearRootback to summary
private void clearRoot()
containsback to summary
public boolean contains(final String name)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.contains.

Return whether or not this Type is in the imports.

containsback to summary
public boolean contains(final Type type)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.contains.

copyback to summary
public ImportList copy()

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.copy.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ImportList.copy.

Return a copy of this ImportList.

getInOrderListback to summary
public List<Pair<String, String>> getInOrderList()

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.getInOrderList.

Return a list of imports as (packageName,className) pairs. The list is sorted lexicographically.

insertTypeback to summary
private void insertType(final Type type)
lookupback to summary
public Type lookup(final String className)

Implements org.glassfish.pfl.dynamic.codegen.spi.ImportList.lookup.

Lookup just the className, without package name.

updateRootback to summary
private void updateRoot()
org.glassfish.pfl.dynamic.codegen.impl back to summary

private abstract Class ImportListImpl.Node

extends Object
implements Comparable<ImportListImpl.Node>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
private
Node(final String name)

Method Summary

Modifier and TypeMethod and Description
public void
add(final ImportListImpl.Node node)

public List<ImportListImpl.Node>
public final int
compareTo(final ImportListImpl.Node node)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public void
depthFirst(final UnaryVoidFunction<ImportListImpl.Node> fn)
References Deprecated UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.

public ImportListImpl.Node
find(final String name)

public static ImportListImpl.Node
makeListNode(final String name)

public static ImportListImpl.Node
makeTypeNode(final String name, final Type type)

public final String
name()

public void
sort()

public Type
type()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private final String name

Constructor Detail

Nodeback to summary
private Node(final String name)

Method Detail

addback to summary
public void add(final ImportListImpl.Node node)
childrenback to summary
public List<ImportListImpl.Node> children()
compareToback to summary
public final int compareTo(final ImportListImpl.Node node)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

depthFirstback to summary
public void depthFirst(final UnaryVoidFunction<ImportListImpl.Node> fn)

References Deprecated

UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

findback to summary
public ImportListImpl.Node find(final String name)
makeListNodeback to summary
public static ImportListImpl.Node makeListNode(final String name)
makeTypeNodeback to summary
public static ImportListImpl.Node makeTypeNode(final String name, final Type type)
nameback to summary
public final String name()
sortback to summary
public void sort()
typeback to summary
public Type type()