Class IterableType<T>

java.lang.Object
com.saicone.rtag.util.IterableType<T>
Type Parameters:
T - the iterable object type.
All Implemented Interfaces:
Iterable<T>
Direct Known Subclasses:
OptionalType

public abstract class IterableType<T> extends Object implements Iterable<T>
Abstract class to allow any object to be targeted on the enhanced for statement.
  • Constructor Details

    • IterableType

      public IterableType()
  • Method Details

    • getIterable

      protected abstract T getIterable()
      Get the object that can be iterated.
      Returns:
      an iterable object.
    • setIterable

      protected abstract void setIterable(T object)
      Set the object that can be iterated.
      Parameters:
      object - an iterable object.
    • isIterable

      public boolean isIterable()
      Check if the current object can be iterated using for statement.
      This condition can be applied to any Iterable type or array.
      Returns:
      true if the object can be iterated.
    • isNotIterable

      public boolean isNotIterable()
      Same has isIterable() but with inverted result.
      Returns:
      true if the object can't be iterated.
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>