Codota Logo
ID.isNull
Code IndexAdd Codota to your IDE (free)

How to use
isNull
method
in
org.rococoa.ID

Best Java code snippets using org.rococoa.ID.isNull (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: org.rococoa/rococoa-core

private void release() {
  if (ocInstance.isNull())
    return;
  if (logging.isTraceEnabled()) {
    int retainCount = Foundation.cfGetRetainCount(ocInstance);
    logging.trace("finalizing [{} {}], releasing with retain count = {}",
        new Object[] {javaClassName, ocInstance, retainCount});
  }
  Foundation.cfRelease(ocInstance);
}
origin: org.rococoa/rococoa-core

public String fromNative(Object nativeValue, FromNativeContext context) {
  Number nativeValueAsNumber = (Number) nativeValue;
  if (nativeValueAsNumber == null)
    return null;
  ID id = ID.fromLong(nativeValueAsNumber.longValue());
  if (id.isNull())
    return null;            
  return Foundation.toString(id);
}
origin: org.rococoa/rococoa-core

public static <T extends ObjCObject> T wrap(ID id, Class<T> javaClass, boolean retain) {
  if (id == null || id.isNull())
    return null;
  
  // Why would we not want to retain? Well if we are wrapping a Core Foundation
  // created object, or one created with new (alloc init), it will not
  // have been autorelease'd. 
  ObjCObjectInvocationHandler invocationHandler = new ObjCObjectInvocationHandler(id, javaClass, retain);
  return createProxy(javaClass, invocationHandler);        
}

origin: org.rococoa/rococoa-core

public T fromNative(Object nativeValue, FromNativeContext context) {
  Number nativeValueAsNumber = (Number) nativeValue;
  if (nativeValueAsNumber == null)
    return null;
  ID id = ID.fromLong(nativeValueAsNumber.longValue());
  if (id.isNull())
    return null;            
  boolean shouldRetain = shouldRetainFor(context);        
  return Rococoa.wrap(id, javaType, shouldRetain);
}

origin: org.rococoa/rococoa-core

@Override public Object readFrom(Memory buffer, Class<?> type) {
  ID id = ID.fromLong(buffer.getNativeLong(0).longValue());
  if (id.isNull())
    return null;
  return id;
}
@Override public Memory bufferForResult(Object methodCallResult) {
origin: org.rococoa/rococoa-core

private Object invokeCocoa(final Method method, Object[] args) {
  String selectorName = selectorNameFor(method);
  Class<?> returnType = returnTypeFor(method);
  Object[] marshalledArgs = marshallArgsFor(method, args);
  Object result = sendOnThisOrMainThread(method, ocInstance, selectorName, returnType, marshalledArgs);
  if (method.getName().startsWith("init")) {
    handleInitMethod(result);
  }
  fillInReferences(args, marshalledArgs);
  if (result instanceof Pointer && method.getReturnType().equals(String.class))
    // special case for return char*
    return ((Pointer) result).getString(0);
  if (result instanceof ID)
    if (((ID) result).isNull())
      return null;
  return result;
}
origin: org.rococoa/rococoa-core

@Override public Object readFrom(Memory buffer, Class<?> type) {
  ID id = ID.fromLong(buffer.getNativeLong(0).longValue());
  if (id.isNull())
    return null;
  return Foundation.toString(id);
}
@Override public Memory bufferForResult(Object methodCallResult) {
origin: org.rococoa/rococoa-core

public ObjCObjectInvocationHandler(final ID ocInstance, Class<? extends ObjCObject> javaClass, boolean retain) {
  this.ocInstance = ocInstance;
  javaClassName = javaClass.getSimpleName();
  invokeAllMethodsOnMainThread = shouldInvokeMethodsOnMainThread(javaClass);
  releaseOnFinalize = shouldReleaseInFinalize(javaClass);
  if (logging.isTraceEnabled()) {
    int retainCount = Foundation.cfGetRetainCount(ocInstance);
    logging.trace("Creating NSObjectInvocationHandler for id {}, javaclass {}. retain = {}, retainCount = {}",
        new Object[] {ocInstance, javaClass, retain, retainCount});
  }
  if (ocInstance.isNull()) {
    throw new NullPointerException();
  }
  if (retain) {
    if (callAcrossToMainThread()) {
      Foundation.runOnMainThread(new Runnable() {
        public void run() {
          Foundation.cfRetain(ocInstance);
        }});
    } else {
      Foundation.cfRetain(ocInstance);
    }
  }
}
origin: org.rococoa/rococoa-core

@SuppressWarnings("unchecked")
@Override public Object readFrom(Memory buffer, Class<?> type) {
  ID id = ID.fromLong(buffer.getNativeLong(0).longValue());
  if (id.isNull())
    return null;
  return Rococoa.wrap(id, (Class<? extends ObjCObject>) type);
}
@Override public Memory bufferForResult(Object methodCallResult) {
origin: org.rococoa/rococoa-contrib

/** Get the value of a synthesizer property.
 *  @param property the property whose value should be retrieved
 *  @return the value asociated with the property
 *  @throws IllegalArgumentException if an error occurs while reading the property
 */
public NSObject getProperty(SpeechProperty property) throws IllegalArgumentException {
   ObjCObjectByReference errorPtr = new ObjCObjectByReference();
   NSObject result = objectForProperty_error(property.getNativeValue(), errorPtr);
   NSError error = errorPtr.getValueAs(NSError.class);
   //objectForProperty:error isn't well documented, so be very conservative
   if ( result != null && !result.id().isNull() && (error == null || error.id().isNull() || error.code().intValue() == 0) ) {
     return result;
   } else {
     throw new IllegalArgumentException("Could not get property: " + property + ", error: " + error.localizedDescription());
   }
}
org.rococoaIDisNull

Popular methods of ID

  • longValue
  • <init>
  • fromLong
  • getGlobal
  • intValue
  • toNative

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now