Class FirstJVarDeclaration

    • Field Detail

      • mods

        private final int mods
      • type

        private final JType type
      • name

        private final java.lang.String name
      • value

        private final JExpr value
    • Constructor Detail

      • FirstJVarDeclaration

        FirstJVarDeclaration​(int mods,
                             JType type,
                             java.lang.String name,
                             JExpr value)
    • Method Detail

      • write

        public void write​(SourceFileWriter writer)
                   throws java.io.IOException
        Specified by:
        write in interface Writable
        Throws:
        java.io.IOException
      • writeNoSemi

        void writeNoSemi​(SourceFileWriter writer)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • name

        public java.lang.String name()
        Description copied from interface: JVarDeclaration
        Get the variable name.
        Specified by:
        name in interface JVarDeclaration
        Returns:
        the variable name
      • mods

        int mods()
      • add

        public JVarDeclaration add​(java.lang.String name,
                                   JExpr init)
        Description copied from interface: JVarDeclaration
        Add another item to this declaration. Subsequent items always have the same type as this item.
        Specified by:
        add in interface JVarDeclaration
        Parameters:
        name - the variable name
        init - the variable initializer
        Returns:
        the subsequent declaration
      • add

        public JVarDeclaration add​(java.lang.String name)
        Description copied from interface: JVarDeclaration
        Add another item to this declaration. Subsequent items always have the same type as this item.
        Specified by:
        add in interface JVarDeclaration
        Parameters:
        name - the variable name
        Returns:
        the subsequent declaration
      • getModifiers

        public int getModifiers()
        Description copied from interface: JClassItem
        Get the modifiers of this item.
        Specified by:
        getModifiers in interface JClassItem
        Returns:
        the modifiers
        See Also:
        JMod
      • hasAllModifiers

        public boolean hasAllModifiers​(int mods)
        Description copied from interface: JClassItem
        Determine whether this item has all of the modifiers specified by the given bitwise-OR-joined argument.
        Specified by:
        hasAllModifiers in interface JClassItem
        Parameters:
        mods - the modifier(s)
        Returns:
        true if all of the modifiers are present, false otherwise
      • hasAnyModifier

        public boolean hasAnyModifier​(int mods)
        Description copied from interface: JClassItem
        Determine whether this item has any of the modifiers specified by the given bitwise-OR-joined argument.
        Specified by:
        hasAnyModifier in interface JClassItem
        Parameters:
        mods - the modifier(s)
        Returns:
        true if any if the modifiers are present, false otherwise
      • getName

        public java.lang.String getName()
        Description copied from interface: JClassItem
        Get the name of this element, if there is one.
        Specified by:
        getName in interface JClassItem
        Returns:
        the name, or null if there is none