All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cb.petal.QuiduObject Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2001 Markus Dahm
 * Copyright (C) 2015-2018 BITPlan GmbH http://www.bitplan.com
 *
 * This source is part of
 * https://github.com/BITPlan/CrazyBeans
 * and the license as outlined there applies
 */
package cb.petal;

import java.util.*;

/**
 * Super class for all quid objects that also have a quidu property
 * defined.
 *
 * @version $Id: QuiduObject.java,v 1.5 2001/06/22 09:10:36 dahm Exp $
 * @author M. Dahm
 */
public abstract class QuiduObject extends QuidObject implements HasQuidu {
  protected QuiduObject(PetalNode parent, String name, Collection params) {
    super(parent, name, params);
  }

  protected QuiduObject(String name) {
    super(name);
  }

  static String getQuidu(HasQuidu obj) {
    return PetalObject.getPropertyAsString((PetalObject)obj, "quidu");
  }

  public void setQuidu(String quid) {
    defineProperty("quidu", quid);
  }

  public String getQuidu() {
    return getQuidu(this);
  }

  public long getQuiduAsLong() {
    return Long.parseLong(getQuidu(), 16);
  }

  public void setQuiduAsLong(long quid) {
    defineProperty("quidu", Long.toHexString(quid).toUpperCase());
  }

  public final QuidObject getReferencedObject() {
    return getRoot().getReferencedObject(this);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy