+
+ +

Class UnitDatabase.PrefixedUnitMap.PrefixedUnitEntrySet.PrefixedUnitEntryIterator

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.unitConverter.unit.UnitDatabase.PrefixedUnitMap.PrefixedUnitEntrySet.PrefixedUnitEntryIterator
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.util.Iterator<java.util.Map.Entry<java.lang.String,​Unit>>
    +
    +
    +
    Enclosing class:
    +
    UnitDatabase.PrefixedUnitMap.PrefixedUnitEntrySet
    +
    +
    +
    private static final class UnitDatabase.PrefixedUnitMap.PrefixedUnitEntrySet.PrefixedUnitEntryIterator
    +extends java.lang.Object
    +implements java.util.Iterator<java.util.Map.Entry<java.lang.String,​Unit>>
    +
    An iterator that iterates over the units of a PrefixedUnitNameSet.
    +
    +
    Since:
    +
    2019-04-14, v0.2.0
    +
    Author:
    +
    Adrien Hopkins
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      private java.util.Map<java.lang.String,​Unit>map 
      private java.util.List<java.lang.Integer>prefixCoordinates 
      private java.util.List<java.lang.String>prefixNames 
      private intunitNamePosition 
      private java.util.List<java.lang.String>unitNames 
      +
    • +
    +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      private java.lang.StringgetCurrentUnitName() 
      booleanhasNext() 
      private voidincrementPosition() +
      Changes this iterator's position to the next available one.
      +
      java.util.Map.Entry<java.lang.String,​Unit>next() 
      private java.util.Map.Entry<java.lang.String,​Unit>peek() 
      java.lang.StringtoString() +
      Returns a string representation of the object.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.Iterator

        +forEachRemaining, remove
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        unitNamePosition

        +
        private int unitNamePosition
        +
      • +
      + + + +
        +
      • +

        prefixCoordinates

        +
        private final java.util.List<java.lang.Integer> prefixCoordinates
        +
      • +
      + + + +
        +
      • +

        map

        +
        private final java.util.Map<java.lang.String,​Unit> map
        +
      • +
      + + + +
        +
      • +

        unitNames

        +
        private final transient java.util.List<java.lang.String> unitNames
        +
      • +
      + + + +
        +
      • +

        prefixNames

        +
        private final transient java.util.List<java.lang.String> prefixNames
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PrefixedUnitEntryIterator

        +
        public PrefixedUnitEntryIterator​(UnitDatabase.PrefixedUnitMap map)
        +
        Creates the UnitsDatabase.PrefixedUnitMap.PrefixedUnitNameSet.PrefixedUnitNameIterator.
        +
        +
        Since:
        +
        2019-04-14, v0.2.0
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCurrentUnitName

        +
        private java.lang.String getCurrentUnitName()
        +
        +
        Returns:
        +
        current unit name
        +
        Since:
        +
        2019-04-14, v0.2.0
        +
        +
      • +
      + + + +
        +
      • +

        hasNext

        +
        public boolean hasNext()
        +
        +
        Specified by:
        +
        hasNext in interface java.util.Iterator<java.util.Map.Entry<java.lang.String,​Unit>>
        +
        +
      • +
      + + + +
        +
      • +

        incrementPosition

        +
        private void incrementPosition()
        +
        Changes this iterator's position to the next available one.
        +
        +
        Since:
        +
        2019-04-14, v0.2.0
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public java.util.Map.Entry<java.lang.String,​Unit> next()
        +
        +
        Specified by:
        +
        next in interface java.util.Iterator<java.util.Map.Entry<java.lang.String,​Unit>>
        +
        +
      • +
      + + + +
        +
      • +

        peek

        +
        private java.util.Map.Entry<java.lang.String,​Unit> peek()
        +
        +
        Returns:
        +
        the next element in the iterator, without iterating over it
        +
        Since:
        +
        2019-05-03
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Returns a string representation of the object. The exact details of the representation are + unspecified and subject to change.
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        Since:
        +
        2019-05-03
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+