Class: Squash::Java::Argument
- Inherits:
-
Object
- Object
- Squash::Java::Argument
- Defined in:
- lib/squash/java/namespace.rb
Overview
Instance Attribute Summary collapse
-
#dimensionality ⇒ Fixnum
readonly
The number of dimensions for vector values.
-
#type ⇒ Squash::Java::Type
readonly
The argument type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, dimensionality = 0) ⇒ Argument
constructor
A new instance of Argument.
- #inspect ⇒ Object
-
#to_s ⇒ String
The type’s full name, with “[]” appended for arrays.
Constructor Details
#initialize(type, dimensionality = 0) ⇒ Argument
Returns a new instance of Argument.
532 533 534 535 |
# File 'lib/squash/java/namespace.rb', line 532 def initialize(type, dimensionality=0) @type = type @dimensionality = dimensionality end |
Instance Attribute Details
#dimensionality ⇒ Fixnum (readonly)
Returns The number of dimensions for vector values. A type of ‘int[]` has a dimensionality of 2. Scalars have a dimensionality of 0.
529 530 531 |
# File 'lib/squash/java/namespace.rb', line 529 def dimensionality @dimensionality end |
#type ⇒ Squash::Java::Type (readonly)
Returns The argument type.
525 526 527 |
# File 'lib/squash/java/namespace.rb', line 525 def type @type end |
Instance Method Details
#==(other) ⇒ Object
538 539 540 541 542 |
# File 'lib/squash/java/namespace.rb', line 538 def ==(other) other.kind_of?(Squash::Java::Argument) && type == other.type && dimensionality == other.dimensionality end |
#inspect ⇒ Object
548 |
# File 'lib/squash/java/namespace.rb', line 548 def inspect() "#<#{self.class} #{to_s}>" end |
#to_s ⇒ String
Returns The type’s full name, with “[]” appended for arrays.
545 |
# File 'lib/squash/java/namespace.rb', line 545 def to_s() "#{type.full_name}#{'[]'*dimensionality}" end |