Examples of Storage


Examples of algoD.interpreter.parts.Storage.STORAGE

    public STORAGE memory;
    AlgDecoder decoder;
    CODE program;

    public int INIT() {
        memory = new STORAGE();
        int a = memory.INIT();
        if (a != 0) {
            return a;
        }
        a = Translator.INIT();
View Full Code Here

Examples of ch.sahits.game.openpatrician.model.building.impl.Storage

  public TradingOffice(IPlayer player, ICity city, int value){
    this.player=player;
    this.city = city;
    this.baseValue = value;
    this.weapons = new WeaponStorage();
    this.storage = new Storage(player, city);
    lastWeek = new BalanceSheet(city, player);
    currentWeek = new BalanceSheet((BalanceSheet) lastWeek);
    currentWeek.startUpdate();
    new PeriodicalTimeUpdater(EUpdateIntervalRegistration.WEEK, this);
  }
View Full Code Here

Examples of com.extentech.formats.LEO.Storage

  HashMap<Integer, Storage> caches= new HashMap();
  HashMap<Integer, ArrayList<BiffRec>> pivotCacheRecs= new HashMap();
//  HashMap<String, ArrayList> caches= new HashMap();
 
  public void init(StorageTable directories, WorkBookHandle wbh) throws StorageNotFoundException {
    Storage child= directories.getChild("_SX_DB_CUR");
    if (wbh!=null)  {
      caches= new HashMap();
      book= wbh.getWorkBook();   
      if (wbh.getDebugLevel() > 25) {    // KSC: TESTING: make > 25
        Logger.logInfo("PivotCache.init");
      }
    }
   
    while (child!=null) {
      if (wbh!=null)
      caches.put(Integer.valueOf(child.getName()), child);
      ArrayList<BiffRec> curRecs= new ArrayList();
      BlockByteReader bytes= child.getBlockReader();
      int len= bytes.getLength();
      for (int i = 0; i <= len - 4;) {
        byte[] headerbytes = bytes.getHeaderBytes(i);
        short opcode = ByteTools.readShort(headerbytes[0], headerbytes[1]);
        int reclen = ByteTools.readShort(headerbytes[2], headerbytes[3]);
        BiffRec rec = XLSRecordFactory.getBiffRecord( opcode );
        if (wbh!=null) rec.setDebugLevel(wbh.getDebugLevel()); // KSC: added to propogate debug level
       
        // init the mighty rec
        rec.setWorkBook(book);
        rec.setByteReader(bytes);
        rec.setLength((short) reclen);
        rec.setOffset(i);
        rec.init();
/*       
// KSC: TESTING       
    try {
System.out.println(rec.getClass().getName().substring(rec.getClass().getName().lastIndexOf(".")+1) + ": " + Arrays.toString(((PivotCacheRecord)rec).getRecord()));       
    } catch (ClassCastException e) {
System.out.println(rec.getClass().getName().substring(rec.getClass().getName().lastIndexOf(".")+1) + ": " + Arrays.toString(ByteTools.shortToLEBytes(rec.getOpcode())) + Arrays.toString(ByteTools.shortToLEBytes((short)rec.getData().length)) + Arrays.toString(rec.getData()));       
    }
*/   
        if (wbh!=null)
          curRecs.add(rec);
       
        i+=reclen+4;
      }
      if (wbh!=null)             
      pivotCacheRecs.put(Integer.valueOf(child.getName()), curRecs);
      child= directories.getNext(child.getName());
    }
// KSC: TESTING   
//    Logger.logInfo("PivotCache.end init");
  }
View Full Code Here

Examples of com.geekhub.lessons.lesson7.storage.Storage

public class Test {
   public static void main(String[] args) throws Exception {
        Connection connection = createConnection("root", "root", "geekdb");

        Storage storage = new DatabaseStorage(connection);
        List<Cat> cats = storage.list(Cat.class);
        for (Cat cat : cats) {
            storage.delete(cat);
        }
        cats = storage.list(Cat.class);
        if (!cats.isEmpty()) throw new Exception("Cats should not be in database!");

        for (int i = 1; i <= 20; i++) {
            Cat cat = new Cat();
            cat.setName("cat" + i);
            cat.setAge(i);
            storage.save(cat);
        }

        cats = storage.list(Cat.class);
        if (cats.size() != 20) throw new Exception("Number of cats in storage should be 20!");

        User user = new User();
        user.setAdmin(true);
        user.setAge(23);
        user.setName("Victor");
        user.setBalance(22.23);
        storage.save(user);

        User user1 = storage.get(User.class, user.getId());
        if (!user1.getName().equals(user.getName())) throw new Exception("Users should be equals!");

        user.setAdmin(false);
        storage.save(user);

        User user2 = storage.get(User.class, user.getId());
        if (!user.getAdmin().equals(user2.getAdmin())) throw new Exception("Users should be updated!");

        storage.delete(user1);

        User user3 = storage.get(User.class, user.getId());

        if (user3 != null) throw new Exception("User should be deleted!");

        connection.close();
    }
View Full Code Here

Examples of com.google.api.services.storage.Storage

  @Test
  public void testDescribeRequestAndResponseForApiClient() throws Exception {
    HttpRequestInitializer initializer = mock(HttpRequestInitializer.class);
    NetHttpTransport transport = new NetHttpTransport();
    Storage storage = new Storage.Builder(transport, new JacksonFactory(), initializer)
        .setApplicationName("bla").build();
    HttpRequest request = storage.objects().delete("b", "o").buildHttpRequest();
    request.getHeaders().clear();
    request.getHeaders().put("k1", "v1");
    request.getHeaders().put("k2", "v2");
    HttpResponseException exception = null;
    try {
View Full Code Here

Examples of com.google.code.gwt.storage.client.Storage

    }
   
    // get the locale if stored in the browser
    String localeStored = "";
    if (Storage.isSupported()) {
      Storage localStorage = Storage.getLocalStorage();
      localeStored = localStorage.getItem("locale");
    }
   
    // select the right locale in the list if one is predefined
    if (localeStored != null) {
      for (int i = 0; i < languageSelector.getItemCount(); i++) {
        if ( localeStored.equals(languageSelector.getValue(i))) {
          languageSelector.setSelectedIndex(i);
        }
      }
    // otherwise provide the default
    else {
      for (int i = 0; i < languageSelector.getItemCount(); i++) {
        if (languageSelector.getValue(i).equals("default")) {
          languageSelector.setSelectedIndex(i);
        }
      }
    }
   
    sectionChangeLocale.add(titleCL);
    sectionChangeLocale.add(instructionCL);
    sectionChangeLocale.add(changeLocale);
    account.add(sectionChangeLocale);
   
    addWidgetRow(changeLocale, uiText.Language(), languageSelector);
   
    languageSelector.addChangeHandler(new ChangeHandler() {

      @Override
      public void onChange(ChangeEvent event) {
       
        String value = languageSelector.getValue(languageSelector.getSelectedIndex())
       
        // store the new default value if possible or remove the value in case
        // of default (English)
        if (Storage.isSupported()) {
          Storage localStorage = Storage.getLocalStorage();
         
          if (value.equals("default")) {
            localStorage.removeItem("locale");
          } else {
            localStorage.setItem("locale", value);
          }
         
        }
       
        // construct the new url with the locale parameter
View Full Code Here

Examples of com.google.gwt.storage.client.Storage

    /**
     * Reads the stored state from localStorage.
     */
    private void readStoredState() {
        Storage storage = Storage.getLocalStorageIfSupported();
        if (storage == null) {
            return;
        }

        fullX = readState(storage, STORAGE_FULL_X, -510);
View Full Code Here

Examples of com.google.gwt.storage.client.Storage

     */
    private void writeStoredState() {
        if (isClosed()) {
            return;
        }
        Storage storage = Storage.getLocalStorageIfSupported();
        if (storage == null) {
            return;
        }

        writeState(storage, STORAGE_FULL_X, fullX);
View Full Code Here

Examples of com.google.gwt.storage.client.Storage

    /**
     * Resets (clears) the stored state from localStorage.
     */
    private void resetStoredState() {
        Storage storage = Storage.getLocalStorageIfSupported();
        if (storage == null) {
            return;
        }
        // note: length is live
        for (int i = 0; i < storage.getLength();) {
            String key = storage.key(i);
            if (key.startsWith(STORAGE_PREFIX)) {
                removeState(storage, key.substring(STORAGE_PREFIX.length()));
            } else {
                i++;
            }
View Full Code Here

Examples of com.google.gwt.storage.client.Storage

     * Toggles scroll lock, writes state to persistent storage.
     */
    void toggleScrollLock() {
        setScrollLock(scrollTimer != null);

        Storage storage = Storage.getLocalStorageIfSupported();
        if (storage == null) {
            return;
        }
        VDebugWindow.writeState(storage, "log-scrollLock", scrollTimer == null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.