|
[Sponsors] |
September 18, 2011, 10:48 |
AbsoluteSize and GenericAbsoluteSize classes
|
#1 |
New Member
Jean-François Corbett
Join Date: Aug 2011
Posts: 8
Rep Power: 15 |
What is the difference, if any, between the GenericAbsoluteSize and AbsoluteSize classes?
The STAR-CCM+ macro recorder always seems to cast AbsoluteSize to GenericAbsoluteSize before using it, for example: Code:
GenericAbsoluteSize genericAbsoluteSize_1 = ((GenericAbsoluteSize) volumeSourceSize_0.getAbsoluteSize()); genericAbsoluteSize_1.getValue().setValue(25.0); Code:
volumeSourceSize_0.getAbsoluteSize().getValue().setValue(25.0); |
|
September 18, 2011, 19:22 |
|
#2 |
Senior Member
Join Date: Oct 2009
Location: Germany
Posts: 636
Rep Power: 22 |
GenericAbsoluteSize extends AbsoluteSize. Therefore you should be able to get rid of the cast, as long as you don't use any method of GenericAbsoluteSize which isn't implemented in AbsoluteSize.
setValue() is implemented in AbsoluteSize and inherited to GenericAbsoluteSize, therefore it should be possible not to use the cast. At least I couldn't see anything in GenericAbsoluteSize which suggests, it wouldn't work. But anyway you can be on the safe side and do it in one line even with the cast ((GenericAbsoluteSize) volumeSourceSize_0.getAbsoluteSize()).getValue().s etValue(value); and it's not much more work. |
|
September 21, 2011, 08:19 |
|
#3 | |
New Member
Jean-François Corbett
Join Date: Aug 2011
Posts: 8
Rep Power: 15 |
Thanks abdul099. I also contacted CD-adapco support, and they basically confirmed what you said:
Quote:
|
||
Tags |
absolutesize, genericabsolutesize, java, macro |
|
|