Package java.lang

Examples of java.lang.Object


     */
    public boolean equals(Object obj)
    {
        if (obj instanceof PGobject)
        {
            final Object otherValue = ((PGobject)obj).getValue();
       
            if (otherValue == null){
              return getValue() == null;
            }
            return otherValue.equals(getValue());
        }
        return false;
    }
View Full Code Here


   * <p>firePropertyChange</p>
   *
   * @param evt a PropertyChangeEvent object.
   */
  public void firePropertyChange( @Nonnull PropertyChangeEvent evt ) {
    Object oldValue = evt.getOldValue();
    Object newValue = evt.getNewValue();
    if ( oldValue != null && newValue != null && oldValue.equals( newValue ) ) {
      return;
    }

    transientSupport.firePropertyChange( evt );
View Full Code Here

  public Object invoke(Object reader, Object quote) {
    System.out.println("WARNING: reader macro " + macro +
                       " is deprecated; use " + sym.getName() +
                       " instead");
    PushbackReader r = (PushbackReader) reader;
    Object o = read(r, true, null, true);
    return RT.list(sym, o);
  }
View Full Code Here

}

public static class VarReader extends AFn{
  public Object invoke(Object reader, Object quote) {
    PushbackReader r = (PushbackReader) reader;
    Object o = read(r, true, null, true);
//    if(o instanceof Symbol)
//      {
//      Object v = Compiler.maybeResolveIn(Compiler.currentNS(), (Symbol) o);
//      if(v instanceof Var)
//        return v;
View Full Code Here

    IFn fn = dispatchMacros[ch];

    // Try the ctor reader first
    if(fn == null) {
    unread((PushbackReader) reader, ch);
    Object result = ctorReader.invoke(reader, ch);

    if(result != null)
      return result;
    else
      throw Util.runtimeException(String.format("No dispatch macro for: %c", (char) ch));
View Full Code Here

    try
      {
      Var.pushThreadBindings(
          RT.map(ARG_ENV, PersistentTreeMap.EMPTY));
      unread(r, '[');
      Object form = read(r, true, null, true);

      PersistentVector args = PersistentVector.EMPTY;
      PersistentTreeMap argsyms = (PersistentTreeMap) ARG_ENV.deref();
      ISeq rargs = argsyms.rseq();
      if(rargs != null)
        {
        int higharg = (Integer) ((Map.Entry) rargs.first()).getKey();
        if(higharg > 0)
          {
          for(int i = 1; i <= higharg; ++i)
            {
            Object sym = argsyms.valAt(i);
            if(sym == null)
              sym = garg(i);
            args = args.cons(sym);
            }
          }
        Object restsym = argsyms.valAt(-1);
        if(restsym != null)
          {
          args = args.cons(Compiler._AMP_);
          args = args.cons(restsym);
          }
View Full Code Here

    //% alone is first arg
    if(ch == -1 || isWhitespace(ch) || isTerminatingMacro(ch))
      {
      return registerArg(1);
      }
    Object n = read(r, true, null, true);
    if(n.equals(Compiler._AMP_))
      return registerArg(-1);
    if(!(n instanceof Number))
      throw new IllegalStateException("arg literal must be %, %& or %integer");
    return registerArg(((Number) n).intValue());
  }
View Full Code Here

    if(r instanceof LineNumberingPushbackReader)
      {
      line = ((LineNumberingPushbackReader) r).getLineNumber();
      column = ((LineNumberingPushbackReader) r).getColumnNumber()-1;
      }
    Object meta = read(r, true, null, true);
    if(meta instanceof Symbol || meta instanceof String)
      meta = RT.map(RT.TAG_KEY, meta);
    else if (meta instanceof Keyword)
      meta = RT.map(meta, RT.T);
    else if(!(meta instanceof IPersistentMap))
      throw new IllegalArgumentException("Metadata must be Symbol,Keyword,String or Map");

    Object o = read(r, true, null, true);
    if(o instanceof IMeta)
      {
      if(line != -1 && o instanceof ISeq)
        {
        meta = ((IPersistentMap) meta).assoc(RT.LINE_KEY, line).assoc(RT.COLUMN_KEY, column);
        }
      if(o instanceof IReference)
        {
        ((IReference)o).resetMeta((IPersistentMap) meta);
        return o;
        }
      Object ometa = RT.meta(o);
      for(ISeq s = RT.seq(meta); s != null; s = s.next()) {
      IMapEntry kv = (IMapEntry) s.first();
      ometa = RT.assoc(ometa, kv.getKey(), kv.getValue());
      }
      return ((IObj) o).withMeta((IPersistentMap) ometa);
View Full Code Here

    try
      {
      Var.pushThreadBindings(
          RT.map(GENSYM_ENV, PersistentHashMap.EMPTY));

      Object form = read(r, true, null, true);
      return syntaxQuote(form);
      }
    finally
      {
      Var.popThreadBindings();
View Full Code Here

      Var.popThreadBindings();
      }
  }

  static Object syntaxQuote(Object form) {
    Object ret;
    if(Compiler.isSpecial(form))
      ret = RT.list(Compiler.QUOTE, form);
    else if(form instanceof Symbol)
      {
      Symbol sym = (Symbol) form;
      if(sym.ns == null && sym.name.endsWith("#"))
        {
        IPersistentMap gmap = (IPersistentMap) GENSYM_ENV.deref();
        if(gmap == null)
          throw new IllegalStateException("Gensym literal not in syntax-quote");
        Symbol gs = (Symbol) gmap.valAt(sym);
        if(gs == null)
          GENSYM_ENV.set(gmap.assoc(sym, gs = Symbol.intern(null,
                                                            sym.name.substring(0, sym.name.length() - 1)
                                                            + "__" + RT.nextID() + "__auto__")));
        sym = gs;
        }
      else if(sym.ns == null && sym.name.endsWith("."))
        {
        Symbol csym = Symbol.intern(null, sym.name.substring(0, sym.name.length() - 1));
        csym = Compiler.resolveSymbol(csym);
        sym = Symbol.intern(null, csym.name.concat("."));
        }
      else if(sym.ns == null && sym.name.startsWith("."))
        {
        // Simply quote method names.
        }
      else
        {
        Object maybeClass = null;
        if(sym.ns != null)
          maybeClass = Compiler.currentNS().getMapping(
              Symbol.intern(null, sym.ns));
        if(maybeClass instanceof Class)
          {
View Full Code Here

TOP

Related Classes of java.lang.Object

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.