Qwylt

java.lang.module.spi
Class ExportList<T extends Export>

java.lang.Object
  extended by java.lang.module.spi.ExportList<T>

public class ExportList<T extends Export>
extends java.lang.Object

A list of Export instances that can be retrieved using an ExportMatcher or by name and scope.

Since:
Jan 6, 2010
Author:
Bryan Atsatt, adapted from HashMap.

Constructor Summary
ExportList(java.util.List<T> exports)
          Constructor.
 
Method Summary
 java.util.List<T> asList()
          Returns the exports as a List.
 boolean contains(ExportMatcher matcher)
          Returns true if this list has an entry that matches the specified matcher.
 T get(ExportMatcher matcher)
          Returns the first entry that matches the specified matcher or null if none.
 T get(ScopedName.Scope scope, java.lang.String name)
          Returns the first entry that matches the specified scope and name or null if none.
 java.util.List<T> getAll(ExportMatcher matcher)
          Returns all entries that match the specified matcher.
 boolean isEmpty()
          Returns true if this list has no entries.
 int size()
          Returns the number of entries in this list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExportList

public ExportList(java.util.List<T> exports)
Constructor.

Parameters:
exports - The list of exports.
Method Detail

size

public int size()
Returns the number of entries in this list.

Returns:
the number of entries in this list.

isEmpty

public boolean isEmpty()
Returns true if this list has no entries.

Returns:
true if this list has no entries.

contains

public boolean contains(ExportMatcher matcher)
Returns true if this list has an entry that matches the specified matcher.

Parameters:
matcher - The matcher.
Returns:
true if this list has an entry that matches the specified matcher.

get

public T get(ExportMatcher matcher)
Returns the first entry that matches the specified matcher or null if none.

Parameters:
matcher - The matcher.
Returns:
The first entry that matches the specified matcher or null if none.

getAll

public java.util.List<T> getAll(ExportMatcher matcher)
Returns all entries that match the specified matcher.

Parameters:
matcher - The matcher.
Returns:
All entries that match the specified matcher, empty if none.

get

public T get(ScopedName.Scope scope,
             java.lang.String name)
Returns the first entry that matches the specified scope and name or null if none.

Parameters:
scope - The scope.
name - The name
Returns:
The first entry that matches the specified scope and name or null if none.

asList

public java.util.List<T> asList()
Returns the exports as a List.

Returns:
The exports.

Qwylt

Send comments or questions to Bryan Atsatt