Package de.uniluebeck.itm.tcpip

Examples of de.uniluebeck.itm.tcpip.Storage


    }

    @Override
    protected Integer readValue(Command resp)
        throws TraCIException {
      Storage content = resp.content();
      Utils.checkType(content, Constants.TYPE_INTEGER);
      return content.readInt();
    }
View Full Code Here


      super(dis, dos, commandID, objectID, varID);
    }

    @Override
    protected Double readValue(Command resp) throws TraCIException {
      Storage content = resp.content();
      Utils.checkType(content, Constants.TYPE_DOUBLE);
      return content.readDouble();
    }
View Full Code Here

      super(dis, dos, commandID, objectID, varID);
    }

    @Override
    protected Color readValue(Command resp) throws TraCIException {
      Storage content = resp.content();
      Utils.checkType(content, Constants.TYPE_COLOR);
      int r = content.readUnsignedByte();
      int g = content.readUnsignedByte();
      int b = content.readUnsignedByte();
      int a = content.readUnsignedByte();
      return new Color(r, g, b, a);
    }
View Full Code Here

        throw new IllegalArgumentException("invalid position type");
    }

    @Override
    protected Point2D readValue(Command resp) throws TraCIException {
      Storage content = resp.content();
      Utils.checkType(content, positionType);
      double x = content.readDouble();
      double y = content.readDouble();
      return new Point2D.Double(x, y);
    }
View Full Code Here

    StringQ(DataInputStream dis, DataOutputStream dos, int commandID, String objectID, int varID) {
      super(dis, dos, commandID, objectID, varID);
    }
   
    protected String readValue(Command resp) throws TraCIException {
      Storage content = resp.content();
      Utils.checkType(content, Constants.TYPE_STRING);
      return content.readStringASCII();
    }
View Full Code Here

      super(dis, dos, commandID, vehicleID, varID);
    }

    @Override
    protected Rectangle2D readValue(Command resp) throws TraCIException {
      Storage content = resp.content();
      return new it.polito.appeal.traci.protocol.BoundingBox(content, true);
    }
View Full Code Here

      this.repo = repo;
    }

    @Override
    protected V readValue(Command resp) throws TraCIException {
      Storage content = resp.content();
      Utils.checkType(content, Constants.TYPE_STRING);
      String id = content.readStringASCII();
      try {
        return repo.getByID(id);
      } catch (IOException e) {
        throw new TraCIException(e.toString());
      }
View Full Code Here

    short[] buf = new short[contentLen];
    for (int i=0; i<contentLen; i++) {
      buf[i] = (byte)rawStorage.readUnsignedByte();
    }
   
    content = new Storage(buf);
  }
View Full Code Here

   * @param id
   */
  public Command(int id) {
    if (id > 255)
      throw new IllegalArgumentException("id should fit in a byte");
    content = new Storage();
    this.id = id;
  }
View Full Code Here

   
    dos.writeInt(totalLen);


    for (Command cmd : commands) {
      Storage s = new Storage();
      cmd.writeRawTo(s);
      writeStorage(s, dos, checksum);
    }

    if (log.isDebugEnabled())
View Full Code Here

TOP

Related Classes of de.uniluebeck.itm.tcpip.Storage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.