-
- -

Class UnitDatabase.PrefixedUnitMap.PrefixedUnitNameSet.PrefixedUnitNameIterator

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.unitConverter.unit.UnitDatabase.PrefixedUnitMap.PrefixedUnitNameSet.PrefixedUnitNameIterator
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.util.Iterator<java.lang.String>
    -
    -
    -
    Enclosing class:
    -
    UnitDatabase.PrefixedUnitMap.PrefixedUnitNameSet
    -
    -
    -
    private static final class UnitDatabase.PrefixedUnitMap.PrefixedUnitNameSet.PrefixedUnitNameIterator
    -extends java.lang.Object
    -implements java.util.Iterator<java.lang.String>
    -
    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.lang.Stringnext() 
      private java.lang.Stringpeek() 
      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

      - - - -
        -
      • -

        PrefixedUnitNameIterator

        -
        public PrefixedUnitNameIterator​(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.lang.String>
        -
        -
      • -
      - - - -
        -
      • -

        incrementPosition

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

        next

        -
        public java.lang.String next()
        -
        -
        Specified by:
        -
        next in interface java.util.Iterator<java.lang.String>
        -
        -
      • -
      - - - -
        -
      • -

        peek

        -
        private java.lang.String 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
        -
        -
      • -
      -
    • -
    -
    -
  • -
-
-
-