예제 #1
0
파일: DimNames.java 프로젝트: chumer/fastr
 @Specialization
 protected Object getDimNames(RAbstractContainer container) {
   controlVisibility();
   RList names;
   if (container instanceof RDataFrame) {
     dataframeProfile.enter();
     names = ((RDataFrame) container).getVector().getDimNames();
   } else if (container instanceof RFactor) {
     factorProfile.enter();
     names = ((RFactor) container).getVector().getDimNames();
   } else {
     otherProfile.enter();
     names = container.getDimNames(attrProfiles);
   }
   return nullProfile.profile(names == null) ? RNull.instance : names;
 }
예제 #2
0
 @Specialization(guards = "isLengthOne(lengthVector)")
 protected RAbstractContainer updateLength(
     RAbstractContainer container, RAbstractIntVector lengthVector) {
   controlVisibility();
   return container.resize(lengthVector.getDataAt(0));
 }