de.frag.umlplugin.psi
Class DependencyCollection

java.lang.Object
  extended by de.frag.umlplugin.psi.DependencyCollection
All Implemented Interfaces:
java.lang.Iterable<com.intellij.psi.PsiClass>

public class DependencyCollection
extends java.lang.Object
implements java.lang.Iterable<com.intellij.psi.PsiClass>

Contains several dependencies from one class to another.


Nested Class Summary
static interface DependencyCollection.Filter
          Filter for restricting dependency collection contents.
 
Field Summary
static DependencyCollection.Filter FIELD_FILTER
          Filter that accepts only fields.
 
Constructor Summary
DependencyCollection()
           
 
Method Summary
 void addDependency(com.intellij.psi.PsiClass psiClass, UsageType usageType, int offset)
          Adds a dependency.
 DependencyCollection filter(DependencyCollection.Filter filter)
          Filter contents of this dependency collection and return new restricted collection.
 java.util.List<DependencyReason> getDependencyReasons(com.intellij.psi.PsiClass psiClass)
          Gets a list of dependency reasons for given PSI class.
 java.util.Iterator<com.intellij.psi.PsiClass> iterator()
          Gets an iterator that iterates over all dependencies.
 java.lang.String toString()
          Creates a string representation of this collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIELD_FILTER

public static final DependencyCollection.Filter FIELD_FILTER
Filter that accepts only fields.

Constructor Detail

DependencyCollection

public DependencyCollection()
Method Detail

addDependency

public void addDependency(@NotNull
                          com.intellij.psi.PsiClass psiClass,
                          @NotNull
                          UsageType usageType,
                          int offset)
Adds a dependency.

Parameters:
psiClass - PSI class
usageType - type of usage for given PSI class
offset - source offset

iterator

@NotNull
public java.util.Iterator<com.intellij.psi.PsiClass> iterator()
Gets an iterator that iterates over all dependencies.

Specified by:
iterator in interface java.lang.Iterable<com.intellij.psi.PsiClass>
Returns:
iterator that iterates over all dependencies

getDependencyReasons

@NotNull
public java.util.List<DependencyReason> getDependencyReasons(@NotNull
                                                                     com.intellij.psi.PsiClass psiClass)
Gets a list of dependency reasons for given PSI class.

Parameters:
psiClass - PSI class to get dependency reasons for
Returns:
list of dependency reasons (may be empty)

filter

@NotNull
public DependencyCollection filter(@NotNull
                                           DependencyCollection.Filter filter)
Filter contents of this dependency collection and return new restricted collection.

Parameters:
filter - filter to use for filtering this collection.
Returns:
new collection that only contains dependencies accepted by given filter

toString

@NotNull
public java.lang.String toString()
Creates a string representation of this collection.

Overrides:
toString in class java.lang.Object
Returns:
string representation