Module JavaClass::SimpleNameLogic
In: lib/javaclass/java_name.rb

Mixin with logic to work with Java simple names. The "mixer" needs to declare a String field @simple_name.

Author:Peter Kofler

Methods

Public Instance methods

Return the simple name of this class or package. This returns just the plain String.

[Source]

# File lib/javaclass/java_name.rb, line 52
    def simple_name
      @simple_name
    end

Split the simple name at the camel case boundary pos and return two parts. pos may be < 0 for counting backwards.

[Source]

# File lib/javaclass/java_name.rb, line 57
    def split_simple_name(pos)
      parts = @simple_name.scan(/([A-Z][^A-Z]+)/).flatten
      pos = parts.size + pos + 1 if pos < 0
      return ['', @simple_name] if pos <= 0
      return [@simple_name, ''] if pos >= parts.size
      [parts[0...pos].join, parts[pos..-1].join]
    end

[Validate]