Class StringUtils.CharacterEntitySolver

  • Enclosing class:
    StringUtils

    private static class StringUtils.CharacterEntitySolver
    extends java.lang.Object
    Stores a list en entities and is able to return one given its numeric value or name.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String[] toName
      Map of names of entities according to their numeric value.
      private java.util.Map<java.lang.String,​java.lang.Integer> toValue
      Map of numeric values of entities according to their name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.Integer value, java.lang.String name)
      Adds an entity to solve.
      java.lang.String getName​(int value)
      Returns the entity name according to its numeric value.
      java.lang.Integer getValue​(java.lang.String name)
      Returns the numeric value of an entity according to its name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • toName

        private java.lang.String[] toName
        Map of names of entities according to their numeric value.
      • toValue

        private java.util.Map<java.lang.String,​java.lang.Integer> toValue
        Map of numeric values of entities according to their name.
    • Constructor Detail

      • CharacterEntitySolver

        public CharacterEntitySolver()
        Constructor.
    • Method Detail

      • add

        public void add​(java.lang.Integer value,
                        java.lang.String name)
        Adds an entity to solve.
        Parameters:
        value - The numeric value of the entity.
        name - The name of the entity.
      • getName

        public java.lang.String getName​(int value)
        Returns the entity name according to its numeric value.
        Parameters:
        value - The numeric value of the entity.
        Returns:
        The entity name according to its numeric value.
      • getValue

        public java.lang.Integer getValue​(java.lang.String name)
        Returns the numeric value of an entity according to its name.
        Parameters:
        name - The name of the entity.
        Returns:
        The numeric value of an entity according to its name.