Esempio n. 1
0
  public void readExternal(final RJIO io, final RObjectFactory factory) throws IOException {
    // -- options
    final int options = io.readInt();
    final boolean customClass = ((options & RObjectFactory.O_CLASS_NAME) != 0);
    // -- special attributes
    if (customClass) {
      this.className1 = io.readString();
    }
    final int[] dim = io.readIntArray();
    this.dimAttribute = new RIntegerDataImpl(dim);
    if ((options & RObjectFactory.O_WITH_NAMES) != 0) {
      final RCharacterDataImpl names0 = new RCharacterDataImpl(io);
      final RStore[] names1 = new RStore[dim.length];
      for (int i = 0; i < dim.length; i++) {
        names1[i] = factory.readNames(io);
      }
      this.dimnamesAttribute = new SimpleRListImpl<RStore>(names0, names1);
    }
    // -- data
    this.data = (DataType) factory.readStore(io);

    if (!customClass) {
      this.className1 = (dim.length == 2) ? RObject.CLASSNAME_MATRIX : RObject.CLASSNAME_ARRAY;
    }
    // -- attributes
    if ((options & RObjectFactory.F_WITH_ATTR) != 0) {
      setAttributes(factory.readAttributeList(io));
    }
  }
Esempio n. 2
0
 public void readExternal(final RJIO io, final RObjectFactory factory) throws IOException {
   /*final int options =*/ io.readInt();
   final String headerSource = io.readString();
   if (headerSource != null && headerSource.length() > 0) {
     final RScanner scanner = new RScanner(new StringParseInput(headerSource), null);
     final FDef fDef = scanner.scanFDef();
     if (fDef != null) {
       fArgs = SourceAnalyzer.createMethodArgDef(fDef, null);
     }
   }
 }
 public void writeExternal(final RJIO io) throws IOException {
   io.writeInt(this.properties);
   switch (this.properties & 0xf) {
     case FRAME:
       io.writeLong(this.frameId);
       break;
     case FUNCTION:
       io.writeInt((int) this.frameId);
       io.writeString(this.fName);
       break;
     default:
       break;
   }
 }
 public SetDebugRequest(final RJIO io) throws IOException {
   this.properties = io.readInt();
   switch (this.properties & 0xf) {
     case FRAME:
       this.frameId = io.readLong();
       this.fName = null;
       break;
     case FUNCTION:
       this.frameId = io.readInt();
       this.fName = io.readString();
       break;
     default:
       this.frameId = 0;
       this.fName = null;
       break;
   }
 }
Esempio n. 5
0
 public void writeExternal(final RJIO io, final RObjectFactory factory) throws IOException {
   // -- options
   int options = 0;
   final boolean customClass =
       !this.className1.equals(
           (this.dimAttribute.getLength() == 2)
               ? RObject.CLASSNAME_MATRIX
               : RObject.CLASSNAME_ARRAY);
   if (customClass) {
     options |= RObjectFactory.O_CLASS_NAME;
   }
   if ((io.flags & RObjectFactory.F_ONLY_STRUCT) == 0 && this.dimnamesAttribute != null) {
     options |= RObjectFactory.O_WITH_NAMES;
   }
   final RList attributes =
       ((io.flags & RObjectFactory.F_WITH_ATTR) != 0) ? getAttributes() : null;
   if (attributes != null) {
     options |= RObjectFactory.O_WITH_ATTR;
   }
   io.writeInt(options);
   // -- special attributes
   if (customClass) {
     io.writeString(this.className1);
   }
   this.dimAttribute.writeExternal(io);
   if ((options & RObjectFactory.O_WITH_NAMES) != 0) {
     ((ExternalizableRStore) this.dimnamesAttribute.getNames()).writeExternal(io);
     for (int i = 0; i < this.dimnamesAttribute.getLength(); i++) {
       factory.writeNames(this.dimnamesAttribute.get(i), io);
     }
   }
   // -- data
   factory.writeStore(this.data, io);
   // -- attributes
   if ((options & RObjectFactory.O_WITH_ATTR) != 0) {
     factory.writeAttributeList(attributes, io);
   }
 }
Esempio n. 6
0
 @Override
 public void writeExternal(final RJIO io) throws IOException {
   io.writeDoubleData(this.realValues, this.length);
 }
Esempio n. 7
0
 public RNumericDataBImpl(final RJIO io, final int length) throws IOException {
   this.length = length;
   this.realValues = io.readDoubleData(new double[length], length);
 }