code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public String toString() {
return "";
} |
Returns a string containing a concise, human-readable description of this
object. Subclasses are encouraged to override this method and provide an
implementation that takes into account the object's type and data. The
default implementation is equivalent to the following expression:
<pre>
getClass().getName() + '@' + Integer.toHexString(hashCode())</pre>
<p>See <a href="{@docRoot}reference/java/lang/Object.html#writing_toString">Writing a useful
{@code toString} method</a>
if you intend implementing your own {@code toString} method.
@return a printable representation of this object.
| Object::toString | java | google/j2objc | jre_emul/stub_classes/java/java/lang/Object.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/Object.java | Apache-2.0 |
protected void finalize() throws Throwable {} |
Invoked when the garbage collector has detected that this instance is no longer reachable.
The default implementation does nothing, but this method can be overridden to free resources.
<p>Note that objects that override {@code finalize} are significantly more expensive than
objects that don't. Finalizers may be run a long time after the object is no longer
reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup.
Note also that finalizers are run on a single VM-wide finalizer thread,
so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary
for a class that has a native peer and needs to call a native method to destroy that peer.
Even then, it's better to provide an explicit {@code close} method (and implement
{@link java.io.Closeable}), and insist that callers manually dispose of instances. This
works well for something like files, but less well for something like a {@code BigInteger}
where typical calling code would have to deal with lots of temporaries. Unfortunately,
code that creates lots of temporaries is the worst kind of code from the point of view of
the single finalizer thread.
<p>If you <i>must</i> use finalizers, consider at least providing your own
{@link java.lang.ref.ReferenceQueue} and having your own thread process that queue.
<p>Unlike constructors, finalizers are not automatically chained. You are responsible for
calling {@code super.finalize()} yourself.
<p>Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer
thread.
See <i>Effective Java</i> Item 7, "Avoid finalizers" for more.
| Object::finalize | java | google/j2objc | jre_emul/stub_classes/java/java/lang/Object.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/Object.java | Apache-2.0 |
public final void notify() {} |
Causes a thread which is waiting on this object's monitor (by means of
calling one of the {@code wait()} methods) to be woken up. If more than
one thread is waiting, one of them is chosen at the discretion of the
VM. The chosen thread will not run immediately. The thread
that called {@code notify()} has to release the object's monitor first.
Also, the chosen thread still has to compete against other threads that
try to synchronize on the same object.
<p>This method can only be invoked by a thread which owns this object's
monitor. A thread becomes owner of an object's monitor
<ul>
<li>by executing a synchronized method of that object;</li>
<li>by executing the body of a {@code synchronized} statement that
synchronizes on the object;</li>
<li>by executing a synchronized static method if the object is of type
{@code Class}.</li>
</ul>
@see #notifyAll
@see #wait()
@see #wait(long)
@see #wait(long,int)
@see java.lang.Thread
| Object::notify | java | google/j2objc | jre_emul/stub_classes/java/java/lang/Object.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/Object.java | Apache-2.0 |
public final void notifyAll() {} |
Causes all threads which are waiting on this object's monitor (by means
of calling one of the {@code wait()} methods) to be woken up. The threads
will not run immediately. The thread that called {@code notify()} has to
release the object's monitor first. Also, the threads still have to
compete against other threads that try to synchronize on the same object.
<p>This method can only be invoked by a thread which owns this object's
monitor. A thread becomes owner of an object's monitor
<ul>
<li>by executing a synchronized method of that object;</li>
<li>by executing the body of a {@code synchronized} statement that
synchronizes on the object;</li>
<li>by executing a synchronized static method if the object is of type
{@code Class}.</li>
</ul>
@throws IllegalMonitorStateException
if the thread calling this method is not the owner of this
object's monitor.
@see #notify
@see #wait()
@see #wait(long)
@see #wait(long,int)
@see java.lang.Thread
| Object::notifyAll | java | google/j2objc | jre_emul/stub_classes/java/java/lang/Object.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/Object.java | Apache-2.0 |
public final void wait(long timeout) throws InterruptedException {} |
Causes the calling thread to wait until another thread calls the {@code
notify()} or {@code notifyAll()} method of this object or until the
specified timeout expires. This method can only be invoked by a thread
which owns this object's monitor; see {@link #notify()} on how a thread
can become the owner of a monitor.
<p>A waiting thread can be sent {@code interrupt()} to cause it to
prematurely stop waiting, so {@code wait} should be called in a loop to
check that the condition that has been waited for has been met before
continuing.
<p>While the thread waits, it gives up ownership of this object's
monitor. When it is notified (or interrupted), it re-acquires the monitor
before it starts running.
<p>A timeout of zero means the calling thread should wait forever unless interrupted or
notified.
@param timeout
the maximum time to wait in milliseconds.
@throws IllegalArgumentException
if {@code millis < 0}.
@throws IllegalMonitorStateException
if the thread calling this method is not the owner of this
object's monitor.
@throws InterruptedException if the current thread has been interrupted.
The interrupted status of the current thread will be cleared before the exception
is thrown.
@see #notify
@see #notifyAll
@see #wait()
@see #wait(long,int)
@see java.lang.Thread
| Object::wait | java | google/j2objc | jre_emul/stub_classes/java/java/lang/Object.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/Object.java | Apache-2.0 |
public final void wait(long timeout, int nanos) throws InterruptedException {} |
Causes the calling thread to wait until another thread calls the {@code
notify()} or {@code notifyAll()} method of this object or until the
specified timeout expires. This method can only be invoked by a thread
that owns this object's monitor; see {@link #notify()} on how a thread
can become the owner of a monitor.
<p>A waiting thread can be sent {@code interrupt()} to cause it to
prematurely stop waiting, so {@code wait} should be called in a loop to
check that the condition that has been waited for has been met before
continuing.
<p>While the thread waits, it gives up ownership of this object's
monitor. When it is notified (or interrupted), it re-acquires the monitor
before it starts running.
<p>A timeout of zero means the calling thread should wait forever unless interrupted or
notified.
@param timeout
the maximum time to wait in milliseconds.
@param nanos
the fraction of a millisecond to wait, specified in
nanoseconds.
@throws IllegalArgumentException
if {@code millis < 0}, {@code nanos < 0} or {@code nanos >
999999}.
@throws IllegalMonitorStateException
if the thread calling this method is not the owner of this
object's monitor.
@throws InterruptedException if the current thread has been interrupted.
The interrupted status of the current thread will be cleared before the exception
is thrown.
@see #notify
@see #notifyAll
@see #wait()
@see #wait(long,int)
@see java.lang.Thread
| Object::wait | java | google/j2objc | jre_emul/stub_classes/java/java/lang/Object.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/Object.java | Apache-2.0 |
public final void wait() throws InterruptedException {} |
Causes the calling thread to wait until another thread calls the {@code
notify()} or {@code notifyAll()} method of this object. This method can
only be invoked by a thread which owns this object's monitor; see
{@link #notify()} on how a thread can become the owner of a monitor.
<p>A waiting thread can be sent {@code interrupt()} to cause it to
prematurely stop waiting, so {@code wait} should be called in a loop to
check that the condition that has been waited for has been met before
continuing.
<p>While the thread waits, it gives up ownership of this object's
monitor. When it is notified (or interrupted), it re-acquires the monitor
before it starts running.
@throws IllegalMonitorStateException
if the thread calling this method is not the owner of this
object's monitor.
@throws InterruptedException if the current thread has been interrupted.
The interrupted status of the current thread will be cleared before the exception
is thrown.
@see #notify
@see #notifyAll
@see #wait(long)
@see #wait(long,int)
@see java.lang.Thread
| Object::wait | java | google/j2objc | jre_emul/stub_classes/java/java/lang/Object.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/Object.java | Apache-2.0 |
public String getName() {
return null;
} |
Returns the name of the field represented by this {@code Field} object.
| Field::getName | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public int getModifiers() {
return 0;
} |
Returns the Java language modifiers for the field represented
by this {@code Field} object, as an integer. The {@code Modifier} class should
be used to decode the modifiers.
@see Modifier
| Field::getModifiers | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public Class<?> getType() {
return null;
} |
Returns a {@code Class} object that identifies the
declared type for the field represented by this
{@code Field} object.
@return a {@code Class} object identifying the declared
type of the field represented by this object
| Field::getType | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public Type getGenericType() {
return null;
} |
Returns a {@code Type} object that represents the declared type for
the field represented by this {@code Field} object.
<p>If the {@code Type} is a parameterized type, the
{@code Type} object returned must accurately reflect the
actual type parameters used in the source code.
<p>If the type of the underlying field is a type variable or a
parameterized type, it is created. Otherwise, it is resolved.
@return a {@code Type} object that represents the declared type for
the field represented by this {@code Field} object
@throws GenericSignatureFormatError if the generic field
signature does not conform to the format specified in
<cite>The Java™ Virtual Machine Specification</cite>
@throws TypeNotPresentException if the generic type
signature of the underlying field refers to a non-existent
type declaration
@throws MalformedParameterizedTypeException if the generic
signature of the underlying field refers to a parameterized type
that cannot be instantiated for any reason
@since 1.5
| Field::getGenericType | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public Class<?> getDeclaringClass() {
return null;
} |
Returns the {@code Class} object representing the class or interface
that declares the field represented by this {@code Field} object.
| Field::getDeclaringClass | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public Object get(Object obj) throws IllegalArgumentException, IllegalAccessException {
return null;
} |
Returns the value of the field represented by this {@code Field}, on
the specified object. The value is automatically wrapped in an
object if it has a primitive type.
<p>The underlying field's value is obtained as follows:
<p>If the underlying field is a static field, the {@code obj} argument
is ignored; it may be null.
<p>Otherwise, the underlying field is an instance field. If the
specified {@code obj} argument is null, the method throws a
{@code NullPointerException}. If the specified object is not an
instance of the class or interface declaring the underlying
field, the method throws an {@code IllegalArgumentException}.
<p>If this {@code Field} object is enforcing Java language access control, and
the underlying field is inaccessible, the method throws an
{@code IllegalAccessException}.
If the underlying field is static, the class that declared the
field is initialized if it has not already been initialized.
<p>Otherwise, the value is retrieved from the underlying instance
or static field. If the field has a primitive type, the value
is wrapped in an object before being returned, otherwise it is
returned as is.
<p>If the field is hidden in the type of {@code obj},
the field's value is obtained according to the preceding rules.
@param obj object from which the represented field's value is
to be extracted
@return the value of the represented field in object
{@code obj}; primitive values are wrapped in an appropriate
object before being returned
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof).
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
| Field::get | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public boolean getBoolean(Object obj) throws IllegalArgumentException, IllegalAccessException {
return false;
} |
Gets the value of a static or instance {@code boolean} field.
@param obj the object to extract the {@code boolean} value
from
@return the value of the {@code boolean} field
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code boolean} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getBoolean | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public byte getByte(Object obj) throws IllegalArgumentException, IllegalAccessException {
return 0;
} |
Gets the value of a static or instance {@code byte} field.
@param obj the object to extract the {@code byte} value
from
@return the value of the {@code byte} field
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code byte} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getByte | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public char getChar(Object obj) throws IllegalArgumentException, IllegalAccessException {
return 0;
} |
Gets the value of a static or instance field of type
{@code char} or of another primitive type convertible to
type {@code char} via a widening conversion.
@param obj the object to extract the {@code char} value
from
@return the value of the field converted to type {@code char}
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code char} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getChar | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public double getDouble(Object obj) throws IllegalArgumentException, IllegalAccessException {
return 0.0;
} |
Gets the value of a static or instance field of type
{@code double} or of another primitive type convertible to
type {@code double} via a widening conversion.
@param obj the object to extract the {@code double} value
from
@return the value of the field converted to type {@code double}
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code double} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getDouble | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public float getFloat(Object obj) throws IllegalArgumentException, IllegalAccessException {
return 0.0f;
} |
Gets the value of a static or instance field of type
{@code float} or of another primitive type convertible to
type {@code float} via a widening conversion.
@param obj the object to extract the {@code float} value
from
@return the value of the field converted to type {@code float}
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code float} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getFloat | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public int getInt(Object obj) throws IllegalArgumentException, IllegalAccessException {
return 0;
} |
Gets the value of a static or instance field of type
{@code int} or of another primitive type convertible to
type {@code int} via a widening conversion.
@param obj the object to extract the {@code int} value
from
@return the value of the field converted to type {@code int}
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code int} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getInt | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public long getLong(Object obj) throws IllegalArgumentException, IllegalAccessException {
return 0L;
} |
Gets the value of a static or instance field of type
{@code long} or of another primitive type convertible to
type {@code long} via a widening conversion.
@param obj the object to extract the {@code long} value
from
@return the value of the field converted to type {@code long}
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code long} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getLong | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public short getShort(Object obj) throws IllegalArgumentException, IllegalAccessException {
return 0;
} |
Gets the value of a static or instance field of type
{@code short} or of another primitive type convertible to
type {@code short} via a widening conversion.
@param obj the object to extract the {@code short} value
from
@return the value of the field converted to type {@code short}
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is inaccessible.
@exception IllegalArgumentException if the specified object is not
an instance of the class or interface declaring the
underlying field (or a subclass or implementor
thereof), or if the field value cannot be
converted to the type {@code short} by a
widening conversion.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#get
| Field::getShort | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void set(Object obj, Object value) throws IllegalArgumentException,
IllegalAccessException {} |
Sets the field represented by this {@code Field} object on the
specified object argument to the specified new value. The new
value is automatically unwrapped if the underlying field has a
primitive type.
<p>The operation proceeds as follows:
<p>If the underlying field is static, the {@code obj} argument is
ignored; it may be null.
<p>Otherwise the underlying field is an instance field. If the
specified object argument is null, the method throws a
{@code NullPointerException}. If the specified object argument is not
an instance of the class or interface declaring the underlying
field, the method throws an {@code IllegalArgumentException}.
<p>If this {@code Field} object is enforcing Java language access control, and
the underlying field is inaccessible, the method throws an
{@code IllegalAccessException}.
<p>If the underlying field is final, the method throws an
{@code IllegalAccessException} unless {@code setAccessible(true)}
has succeeded for this {@code Field} object
and the field is non-static. Setting a final field in this way
is meaningful only during deserialization or reconstruction of
instances of classes with blank final fields, before they are
made available for access by other parts of a program. Use in
any other context may have unpredictable effects, including cases
in which other parts of a program continue to use the original
value of this field.
<p>If the underlying field is of a primitive type, an unwrapping
conversion is attempted to convert the new value to a value of
a primitive type. If this attempt fails, the method throws an
{@code IllegalArgumentException}.
<p>If, after possible unwrapping, the new value cannot be
converted to the type of the underlying field by an identity or
widening conversion, the method throws an
{@code IllegalArgumentException}.
<p>If the underlying field is static, the class that declared the
field is initialized if it has not already been initialized.
<p>The field is set to the possibly unwrapped and widened new value.
<p>If the field is hidden in the type of {@code obj},
the field's value is set according to the preceding rules.
@param obj the object whose field should be modified
@param value the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
| Field::set | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setBoolean(Object obj, boolean b) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as a {@code boolean} on the specified object.
This method is equivalent to
{@code set(obj, zObj)},
where {@code zObj} is a {@code Boolean} object and
{@code zObj.booleanValue() == z}.
@param obj the object whose field should be modified
@param z the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setBoolean | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setByte(Object obj, byte b) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as a {@code byte} on the specified object.
This method is equivalent to
{@code set(obj, bObj)},
where {@code bObj} is a {@code Byte} object and
{@code bObj.byteValue() == b}.
@param obj the object whose field should be modified
@param b the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setByte | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setChar(Object obj, char c) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as a {@code char} on the specified object.
This method is equivalent to
{@code set(obj, cObj)},
where {@code cObj} is a {@code Character} object and
{@code cObj.charValue() == c}.
@param obj the object whose field should be modified
@param c the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setChar | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setDouble(Object obj, double d) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as a {@code double} on the specified object.
This method is equivalent to
{@code set(obj, dObj)},
where {@code dObj} is a {@code Double} object and
{@code dObj.doubleValue() == d}.
@param obj the object whose field should be modified
@param d the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setDouble | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setFloat(Object obj, float f) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as a {@code float} on the specified object.
This method is equivalent to
{@code set(obj, fObj)},
where {@code fObj} is a {@code Float} object and
{@code fObj.floatValue() == f}.
@param obj the object whose field should be modified
@param f the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setFloat | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setInt(Object obj, int i) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as an {@code int} on the specified object.
This method is equivalent to
{@code set(obj, iObj)},
where {@code iObj} is a {@code Integer} object and
{@code iObj.intValue() == i}.
@param obj the object whose field should be modified
@param i the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setInt | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setLong(Object obj, long l) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as a {@code long} on the specified object.
This method is equivalent to
{@code set(obj, lObj)},
where {@code lObj} is a {@code Long} object and
{@code lObj.longValue() == l}.
@param obj the object whose field should be modified
@param l the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setLong | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public void setShort(Object obj, short s) throws IllegalArgumentException, IllegalAccessException {} |
Sets the value of a field as a {@code short} on the specified object.
This method is equivalent to
{@code set(obj, sObj)},
where {@code sObj} is a {@code Short} object and
{@code sObj.shortValue() == s}.
@param obj the object whose field should be modified
@param s the new value for the field of {@code obj}
being modified
@exception IllegalAccessException if this {@code Field} object
is enforcing Java language access control and the underlying
field is either inaccessible or final.
@exception IllegalArgumentException if the specified object is not an
instance of the class or interface declaring the underlying
field (or a subclass or implementor thereof),
or if an unwrapping conversion fails.
@exception NullPointerException if the specified object is null
and the field is an instance field.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
@see Field#set
| Field::setShort | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
return null;
} |
@throws NullPointerException {@inheritDoc}
@since 1.5
| Field::getAnnotation | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public boolean isSynthetic() {
return false;
} |
Returns {@code true} if this field is a synthetic
field; returns {@code false} otherwise.
@return true if and only if this field is a synthetic
field as defined by the Java Language Specification.
@since 1.5
| Field::isSynthetic | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public boolean isEnumConstant() {
return false;
} |
Returns {@code true} if this field represents an element of
an enumerated type; returns {@code false} otherwise.
@return {@code true} if and only if this field represents an element of
an enumerated type.
@since 1.5
| Field::isEnumConstant | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public String toGenericString() {
return null;
} |
Returns a string describing this {@code Field}, including
its generic type. The format is the access modifiers for the
field, if any, followed by the generic field type, followed by
a space, followed by the fully-qualified name of the class
declaring the field, followed by a period, followed by the name
of the field.
<p>The modifiers are placed in canonical order as specified by
"The Java Language Specification". This is {@code public},
{@code protected} or {@code private} first, and then other
modifiers in the following order: {@code static}, {@code final},
{@code transient}, {@code volatile}.
@return a string describing this {@code Field}, including
its generic type
@since 1.5
@jls 8.3.1 Field Modifiers
| Field::toGenericString | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public boolean equals(Object obj) {
return false;
} |
Compares this {@code Field} against the specified object. Returns
true if the objects are the same. Two {@code Field} objects are the same if
they were declared by the same class and have the same name
and type.
| Field::equals | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public int hashCode() {
return -1;
} |
Returns a hashcode for this {@code Field}. This is computed as the
exclusive-or of the hashcodes for the underlying field's
declaring class name and its name.
| Field::hashCode | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public java.lang.String toString() {
return null;
} |
Returns a string describing this {@code Field}. The format is
the access modifiers for the field, if any, followed
by the field type, followed by a space, followed by
the fully-qualified name of the class declaring the field,
followed by a period, followed by the name of the field.
For example:
<pre>
public static final int java.lang.Thread.MIN_PRIORITY
private int java.io.FileDescriptor.fd
</pre>
<p>The modifiers are placed in canonical order as specified by
"The Java Language Specification". This is {@code public},
{@code protected} or {@code private} first, and then other
modifiers in the following order: {@code static}, {@code final},
{@code transient}, {@code volatile}.
@return a string describing this {@code Field}
@jls 8.3.1 Field Modifiers
| Field::toString | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Field.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Field.java | Apache-2.0 |
public int getParameterCount() {
return 0;
} |
Returns the number of formal parameters (whether explicitly
declared or implicitly declared or neither) for the executable
represented by this object.
@return The number of formal parameters for the executable this
object represents
| Executable::getParameterCount | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public Type[] getGenericParameterTypes() {
return null;
} |
Returns an array of {@code Type} objects that represent the formal
parameter types, in declaration order, of the executable represented by
this object. Returns an array of length 0 if the
underlying executable takes no parameters.
<p>If a formal parameter type is a parameterized type,
the {@code Type} object returned for it must accurately reflect
the actual type parameters used in the source code.
<p>If a formal parameter type is a type variable or a parameterized
type, it is created. Otherwise, it is resolved.
@return an array of {@code Type}s that represent the formal
parameter types of the underlying executable, in declaration order
@throws GenericSignatureFormatError
if the generic method signature does not conform to the format
specified in
<cite>The Java™ Virtual Machine Specification</cite>
@throws TypeNotPresentException if any of the parameter
types of the underlying executable refers to a non-existent type
declaration
@throws MalformedParameterizedTypeException if any of
the underlying executable's parameter types refer to a parameterized
type that cannot be instantiated for any reason
| Executable::getGenericParameterTypes | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public Parameter[] getParameters() {
return null;
} |
Returns an array of {@code Parameter} objects that represent
all the parameters to the underlying executable represented by
this object. Returns an array of length 0 if the executable
has no parameters.
<p>The parameters of the underlying executable do not necessarily
have unique names, or names that are legal identifiers in the
Java programming language (JLS 3.8).
@throws MalformedParametersException if the class file contains
a MethodParameters attribute that is improperly formatted.
@return an array of {@code Parameter} objects representing all
the parameters to the executable this object represents.
| Executable::getParameters | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public Type[] getGenericExceptionTypes() {
return null;
} |
Returns an array of {@code Type} objects that represent the
exceptions declared to be thrown by this executable object.
Returns an array of length 0 if the underlying executable declares
no exceptions in its {@code throws} clause.
<p>If an exception type is a type variable or a parameterized
type, it is created. Otherwise, it is resolved.
@return an array of Types that represent the exception types
thrown by the underlying executable
@throws GenericSignatureFormatError
if the generic method signature does not conform to the format
specified in
<cite>The Java™ Virtual Machine Specification</cite>
@throws TypeNotPresentException if the underlying executable's
{@code throws} clause refers to a non-existent type declaration
@throws MalformedParameterizedTypeException if
the underlying executable's {@code throws} clause refers to a
parameterized type that cannot be instantiated for any reason
| Executable::getGenericExceptionTypes | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public boolean isVarArgs() {
return false;
} |
Returns {@code true} if this executable was declared to take a
variable number of arguments; returns {@code false} otherwise.
@return {@code true} if an only if this executable was declared
to take a variable number of arguments.
| Executable::isVarArgs | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public boolean isSynthetic() {
return false;
} |
Returns {@code true} if this executable is a synthetic
construct; returns {@code false} otherwise.
@return true if and only if this executable is a synthetic
construct as defined by
<cite>The Java™ Language Specification</cite>.
@jls 13.1 The Form of a Binary
| Executable::isSynthetic | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public <T extends Annotation> T getAnnotation(Class<T> cls) {
return null;
} |
{@inheritDoc}
@throws NullPointerException {@inheritDoc}
| Executable::getAnnotation | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public Annotation[] getDeclaredAnnotations() {
return null;
} |
{@inheritDoc}
| Executable::getDeclaredAnnotations | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public AnnotatedType getAnnotatedReceiverType() {
return null;
} |
Returns an {@code AnnotatedType} object that represents the use of a
type to specify the receiver type of the method/constructor represented
by this Executable object. The receiver type of a method/constructor is
available only if the method/constructor has a <em>receiver
parameter</em> (JLS 8.4.1).
If this {@code Executable} object represents a constructor or instance
method that does not have a receiver parameter, or has a receiver
parameter with no annotations on its type, then the return value is an
{@code AnnotatedType} object representing an element with no
annotations.
If this {@code Executable} object represents a static method, then the
return value is null.
@return an object representing the receiver type of the method or
constructor represented by this {@code Executable}
@since 1.8
| Executable::getAnnotatedReceiverType | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public AnnotatedType[] getAnnotatedParameterTypes() {
return null;
} |
Returns an array of {@code AnnotatedType} objects that represent the use
of types to specify formal parameter types of the method/constructor
represented by this Executable. The order of the objects in the array
corresponds to the order of the formal parameter types in the
declaration of the method/constructor.
Returns an array of length 0 if the method/constructor declares no
parameters.
@return an array of objects representing the types of the
formal parameters of the method or constructor represented by this
{@code Executable}
@since 1.8
| Executable::getAnnotatedParameterTypes | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public AnnotatedType[] getAnnotatedExceptionTypes() {
return null;
} |
Returns an array of {@code AnnotatedType} objects that represent the use
of types to specify the declared exceptions of the method/constructor
represented by this Executable. The order of the objects in the array
corresponds to the order of the exception types in the declaration of
the method/constructor.
Returns an array of length 0 if the method/constructor declares no
exceptions.
@return an array of objects representing the declared
exceptions of the method or constructor represented by this {@code
Executable}
@since 1.8
| Executable::getAnnotatedExceptionTypes | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Executable.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Executable.java | Apache-2.0 |
public Class<?> getReturnType() {
return null;
} |
Returns a {@code Class} object that represents the formal return type
of the method represented by this {@code Method} object.
@return the return type for the method this object represents
| Method::getReturnType | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public Type getGenericReturnType() {
return null;
} |
Returns a {@code Type} object that represents the formal return
type of the method represented by this {@code Method} object.
<p>If the return type is a parameterized type,
the {@code Type} object returned must accurately reflect
the actual type parameters used in the source code.
<p>If the return type is a type variable or a parameterized type, it
is created. Otherwise, it is resolved.
@return a {@code Type} object that represents the formal return
type of the underlying method
@throws GenericSignatureFormatError
if the generic method signature does not conform to the format
specified in
<cite>The Java™ Virtual Machine Specification</cite>
@throws TypeNotPresentException if the underlying method's
return type refers to a non-existent type declaration
@throws MalformedParameterizedTypeException if the
underlying method's return typed refers to a parameterized
type that cannot be instantiated for any reason
@since 1.5
| Method::getGenericReturnType | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public Class<?> getDeclaringClass() {
return null;
} |
{@inheritDoc}
| Method::getDeclaringClass | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public Object invoke(Object obj, Object... args)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
return null;
} |
Invokes the underlying method represented by this {@code Method}
object, on the specified object with the specified parameters.
Individual parameters are automatically unwrapped to match
primitive formal parameters, and both primitive and reference
parameters are subject to method invocation conversions as
necessary.
<p>If the underlying method is static, then the specified {@code obj}
argument is ignored. It may be null.
<p>If the number of formal parameters required by the underlying method is
0, the supplied {@code args} array may be of length 0 or null.
<p>If the underlying method is an instance method, it is invoked
using dynamic method lookup as documented in The Java Language
Specification, Second Edition, section 15.12.4.4; in particular,
overriding based on the runtime type of the target object will occur.
<p>If the underlying method is static, the class that declared
the method is initialized if it has not already been initialized.
<p>If the method completes normally, the value it returns is
returned to the caller of invoke; if the value has a primitive
type, it is first appropriately wrapped in an object. However,
if the value has the type of an array of a primitive type, the
elements of the array are <i>not</i> wrapped in objects; in
other words, an array of primitive type is returned. If the
underlying method return type is void, the invocation returns
null.
@param obj the object the underlying method is invoked from
@param args the arguments used for the method call
@return the result of dispatching the method represented by
this object on {@code obj} with parameters
{@code args}
@exception IllegalAccessException if this {@code Method} object
is enforcing Java language access control and the underlying
method is inaccessible.
@exception IllegalArgumentException if the method is an
instance method and the specified object argument
is not an instance of the class or interface
declaring the underlying method (or of a subclass
or implementor thereof); if the number of actual
and formal parameters differ; if an unwrapping
conversion for primitive arguments fails; or if,
after possible unwrapping, a parameter value
cannot be converted to the corresponding formal
parameter type by a method invocation conversion.
@exception InvocationTargetException if the underlying method
throws an exception.
@exception NullPointerException if the specified object is null
and the method is an instance method.
@exception ExceptionInInitializerError if the initialization
provoked by this method fails.
| Method::invoke | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
return null;
} |
{@inheritDoc}
@throws NullPointerException {@inheritDoc}
@since 1.5
| Method::getAnnotation | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public Annotation[] getDeclaredAnnotations() {
return null;
} |
{@inheritDoc}
@since 1.5
| Method::getDeclaredAnnotations | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public AnnotatedType getAnnotatedReturnType() {
return null;
} |
{@inheritDoc}
@since 1.8
| Method::getAnnotatedReturnType | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public Annotation[][] getParameterAnnotations() {
return null;
} |
{@inheritDoc}
@since 1.5
| Method::getParameterAnnotations | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public Object getDefaultValue() {
return null;
} |
Returns the default value for the annotation member represented by
this {@code Method} instance. If the member is of a primitive type,
an instance of the corresponding wrapper type is returned. Returns
null if no default is associated with the member, or if the method
instance does not represent a declared member of an annotation type.
@return the default value for the annotation member represented
by this {@code Method} instance.
@throws TypeNotPresentException if the annotation is of type
{@link Class} and no definition can be found for the
default class value.
@since 1.5
| Method::getDefaultValue | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public boolean isBridge() {
return false;
} |
Returns {@code true} if this method is a bridge
method; returns {@code false} otherwise.
@return true if and only if this method is a bridge
method as defined by the Java Language Specification.
@since 1.5
| Method::isBridge | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public boolean isDefault() {
return false;
} |
Returns {@code true} if this method is a default
method; returns {@code false} otherwise.
A default method is a public non-abstract instance method, that
is, a non-static method with a body, declared in an interface
type.
@return true if and only if this method is a default
method as defined by the Java Language Specification.
@since 1.8
| Method::isDefault | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public boolean equals(Object obj) {
return false;
} |
Compares this {@code Method} against the specified object. Returns
true if the objects are the same. Two {@code Methods} are the same if
they were declared by the same class and have the same name
and formal parameter types and return type.
| Method::equals | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public int getParameterCount() {
return -1;
} |
{@inheritDoc}
| Method::getParameterCount | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public int hashCode() {
return -1;
} |
Returns a hashcode for this {@code Method}. The hashcode is computed
as the exclusive-or of the hashcodes for the underlying
method's declaring class name and the method's name.
| Method::hashCode | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public java.lang.String toString() {
return null;
} |
Returns a string describing this {@code Method}. The string is
formatted as the method access modifiers, if any, followed by
the method return type, followed by a space, followed by the
class declaring the method, followed by a period, followed by
the method name, followed by a parenthesized, comma-separated
list of the method's formal parameter types. If the method
throws checked exceptions, the parameter list is followed by a
space, followed by the word throws followed by a
comma-separated list of the thrown exception types.
For example:
<pre>
public boolean java.lang.Object.equals(java.lang.Object)
</pre>
<p>The access modifiers are placed in canonical order as
specified by "The Java Language Specification". This is
{@code public}, {@code protected} or {@code private} first,
and then other modifiers in the following order:
{@code abstract}, {@code default}, {@code static}, {@code final},
{@code synchronized}, {@code native}, {@code strictfp}.
@return a string describing this {@code Method}
@jls 8.4.3 Method Modifiers
| Method::toString | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Method.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Method.java | Apache-2.0 |
public T newInstance(Object ... initargs) throws InstantiationException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException {
return null;
} |
Uses the constructor represented by this {@code Constructor} object to
create and initialize a new instance of the constructor's
declaring class, with the specified initialization parameters.
Individual parameters are automatically unwrapped to match
primitive formal parameters, and both primitive and reference
parameters are subject to method invocation conversions as necessary.
<p>If the number of formal parameters required by the underlying constructor
is 0, the supplied {@code initargs} array may be of length 0 or null.
<p>If the constructor's declaring class is an inner class in a
non-static context, the first argument to the constructor needs
to be the enclosing instance; see section 15.9.3 of
<cite>The Java™ Language Specification</cite>.
<p>If the required access and argument checks succeed and the
instantiation will proceed, the constructor's declaring class
is initialized if it has not already been initialized.
<p>If the constructor completes normally, returns the newly
created and initialized instance.
@param initargs array of objects to be passed as arguments to
the constructor call; values of primitive types are wrapped in
a wrapper object of the appropriate type (e.g. a {@code float}
in a {@link java.lang.Float Float})
@return a new object created by calling the constructor
this object represents
@exception IllegalAccessException if this {@code Constructor} object
is enforcing Java language access control and the underlying
constructor is inaccessible.
@exception IllegalArgumentException if the number of actual
and formal parameters differ; if an unwrapping
conversion for primitive arguments fails; or if,
after possible unwrapping, a parameter value
cannot be converted to the corresponding formal
parameter type by a method invocation conversion; if
this constructor pertains to an enum type.
@exception InstantiationException if the class that declares the
underlying constructor represents an abstract class.
@exception InvocationTargetException if the underlying constructor
throws an exception.
@exception ExceptionInInitializerError if the initialization provoked
by this method fails.
| Constructor::newInstance | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | Apache-2.0 |
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
return null;
} |
{@inheritDoc}
@throws NullPointerException {@inheritDoc}
@since 1.5
| Constructor::getAnnotation | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | Apache-2.0 |
public Annotation[] getDeclaredAnnotations() {
return null;
} |
{@inheritDoc}
@since 1.5
| Constructor::getDeclaredAnnotations | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | Apache-2.0 |
public boolean equals(Object obj) {
return false;
} |
Compares this {@code Constructor} against the specified object.
Returns true if the objects are the same. Two {@code Constructor} objects are
the same if they were declared by the same class and have the
same formal parameter types.
| Constructor::equals | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | Apache-2.0 |
public int getParameterCount() {
return -1;
} |
{@inheritDoc}
| Constructor::getParameterCount | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | Apache-2.0 |
public int hashCode() {
return -1;
} |
Returns a hashcode for this {@code Constructor}. The hashcode is
the same as the hashcode for the underlying constructor's
declaring class name.
| Constructor::hashCode | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | Apache-2.0 |
public java.lang.String toString() {
return null;
} |
Returns a string describing this {@code Constructor}. The string is
formatted as the constructor access modifiers, if any,
followed by the fully-qualified name of the declaring class,
followed by a parenthesized, comma-separated list of the
constructor's formal parameter types. For example:
<pre>
public java.util.Hashtable(int,float)
</pre>
<p>The only possible modifiers for constructors are the access
modifiers {@code public}, {@code protected} or
{@code private}. Only one of these may appear, or none if the
constructor has default (package) access.
@return a string describing this {@code Constructor}
@jls 8.8.3. Constructor Modifiers
| Constructor::toString | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/Constructor.java | Apache-2.0 |
public boolean isAccessible() {
return false;
} |
Get the value of the {@code accessible} flag for this object.
@return the value of the object's {@code accessible} flag
| AccessibleObject::isAccessible | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | Apache-2.0 |
public void setAccessible(boolean flag) throws SecurityException {} |
Set the {@code accessible} flag for this object to
the indicated boolean value. A value of {@code true} indicates that
the reflected object should suppress Java language access
checking when it is used. A value of {@code false} indicates
that the reflected object should enforce Java language access checks.
<p>First, if there is a security manager, its
{@code checkPermission} method is called with a
{@code ReflectPermission("suppressAccessChecks")} permission.
<p>A {@code SecurityException} is raised if {@code flag} is
{@code true} but accessibility of this object may not be changed
(for example, if this element object is a {@link Constructor} object for
the class {@link java.lang.Class}).
<p>A {@code SecurityException} is raised if this object is a {@link
java.lang.reflect.Constructor} object for the class
{@code java.lang.Class}, and {@code flag} is true.
@param flag the new value for the {@code accessible} flag
@throws SecurityException if the request is denied.
@see SecurityManager#checkPermission
@see java.lang.RuntimePermission
| AccessibleObject::setAccessible | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | Apache-2.0 |
public static void setAccessible(AccessibleObject[] array, boolean flag)
throws SecurityException {} |
Convenience method to set the {@code accessible} flag for an
array of objects with a single security check (for efficiency).
<p>First, if there is a security manager, its
{@code checkPermission} method is called with a
{@code ReflectPermission("suppressAccessChecks")} permission.
<p>A {@code SecurityException} is raised if {@code flag} is
{@code true} but accessibility of any of the elements of the input
{@code array} may not be changed (for example, if the element
object is a {@link Constructor} object for the class {@link
java.lang.Class}). In the event of such a SecurityException, the
accessibility of objects is set to {@code flag} for array elements
upto (and excluding) the element for which the exception occurred; the
accessibility of elements beyond (and including) the element for which
the exception occurred is unchanged.
@param array the array of AccessibleObjects
@param flag the new value for the {@code accessible} flag
in each object
@throws SecurityException if the request is denied.
@see SecurityManager#checkPermission
@see java.lang.RuntimePermission
| AccessibleObject::setAccessible | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | Apache-2.0 |
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
return null;
} |
@throws NullPointerException {@inheritDoc}
@since 1.5
| AccessibleObject::getAnnotation | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | Apache-2.0 |
public Annotation[] getAnnotations() {
return null;
} |
@since 1.5
| AccessibleObject::getAnnotations | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | Apache-2.0 |
public Annotation[] getDeclaredAnnotations() {
return null;
} |
@since 1.5
| AccessibleObject::getDeclaredAnnotations | java | google/j2objc | jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | https://github.com/google/j2objc/blob/master/jre_emul/stub_classes/java/java/lang/reflect/AccessibleObject.java | Apache-2.0 |
private static NetworkInterface chooseDefaultInterface() {
Enumeration<NetworkInterface> nifs;
try {
nifs = NetworkInterface.getNetworkInterfaces();
} catch (IOException ignore) {
// unable to enumate network interfaces
return null;
}
NetworkInterface ppp = null;
NetworkInterface loopback = null;
while (nifs.hasMoreElements()) {
NetworkInterface ni = nifs.nextElement();
try {
if (ni.isUp() && ni.supportsMulticast()) {
boolean isLoopback = ni.isLoopback();
boolean isPPP = ni.isPointToPoint();
if (!isLoopback && !isPPP) {
// found an interface that is not the loopback or a
// point-to-point interface
return ni;
}
if (ppp == null && isPPP)
ppp = ni;
if (loopback == null && isLoopback)
loopback = ni;
}
} catch (IOException skip) { }
}
return (ppp != null) ? ppp : loopback;
} |
Choose a default interface. This method returns an interface that is
both "up" and supports multicast. This method choses an interface in
order of preference:
1. neither loopback nor point to point
2. point to point
3. loopback
@return the chosen interface or {@code null} if there isn't a suitable
default
| DefaultInterface::chooseDefaultInterface | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/java/net/DefaultInterface.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/java/net/DefaultInterface.java | Apache-2.0 |
final void register(int fd, PollableChannel ch) {
fdToChannelLock.writeLock().lock();
try {
if (isShutdown())
throw new ShutdownChannelGroupException();
fdToChannel.put(Integer.valueOf(fd), ch);
} finally {
fdToChannelLock.writeLock().unlock();
}
} |
Register channel identified by its file descriptor
| Port::register | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/Port.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/Port.java | Apache-2.0 |
final void unregister(int fd) {
boolean checkForShutdown = false;
fdToChannelLock.writeLock().lock();
try {
fdToChannel.remove(Integer.valueOf(fd));
// last key to be removed so check if group is shutdown
if (fdToChannel.isEmpty())
checkForShutdown = true;
} finally {
fdToChannelLock.writeLock().unlock();
}
// continue shutdown
if (checkForShutdown && isShutdown()) {
try {
shutdownNow();
} catch (IOException ignore) { }
}
} |
Unregister channel identified by its file descriptor
| Port::unregister | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/Port.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/Port.java | Apache-2.0 |
KQueueSelectorImpl(SelectorProvider sp) {
super(sp);
long fds = IOUtil.makePipe(false);
fd0 = (int)(fds >>> 32);
fd1 = (int)fds;
kqueueWrapper = new KQueueArrayWrapper();
kqueueWrapper.initInterrupt(fd0, fd1);
fdMap = new HashMap<>();
totalChannels = 1;
} |
Package private constructor called by factory method in
the abstract superclass Selector.
| MapEntry::KQueueSelectorImpl | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java | Apache-2.0 |
private int updateSelectedKeys(int entries)
throws IOException
{
int numKeysUpdated = 0;
boolean interrupted = false;
// A file descriptor may be registered with kqueue with more than one
// filter and so there may be more than one event for a fd. The update
// count in the MapEntry tracks when the fd was last updated and this
// ensures that the ready ops are updated rather than replaced by a
// second or subsequent event.
updateCount++;
for (int i = 0; i < entries; i++) {
int nextFD = kqueueWrapper.getDescriptor(i);
if (nextFD == fd0) {
interrupted = true;
} else {
MapEntry me = fdMap.get(Integer.valueOf(nextFD));
// entry is null in the case of an interrupt
if (me != null) {
int rOps = kqueueWrapper.getReventOps(i);
SelectionKeyImpl ski = me.ski;
if (selectedKeys.contains(ski)) {
// first time this file descriptor has been encountered on this
// update?
if (me.updateCount != updateCount) {
if (ski.channel.translateAndSetReadyOps(rOps, ski)) {
numKeysUpdated++;
me.updateCount = updateCount;
}
} else {
// ready ops have already been set on this update
ski.channel.translateAndUpdateReadyOps(rOps, ski);
}
} else {
ski.channel.translateAndSetReadyOps(rOps, ski);
if ((ski.nioReadyOps() & ski.nioInterestOps()) != 0) {
selectedKeys.add(ski);
numKeysUpdated++;
me.updateCount = updateCount;
}
}
}
}
}
if (interrupted) {
// Clear the wakeup pipe
synchronized (interruptLock) {
IOUtil.drain(fd0);
interruptTriggered = false;
}
}
return numKeysUpdated;
} |
Update the keys whose fd's have been selected by kqueue.
Add the ready keys to the selected key set.
If the interrupt fd has been selected, drain it and clear the interrupt.
| MapEntry::updateSelectedKeys | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java | Apache-2.0 |
private void implClose() {
synchronized (this) {
if (closed)
return;
closed = true;
}
freePollArray(address);
close0(sp[0]);
close0(sp[1]);
close0(kqfd);
} |
Release all resources
| Event::implClose | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueuePort.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueuePort.java | Apache-2.0 |
static long allocatePollArray(int count) {
return unsafe.allocateMemory(count * SIZEOF_KQUEUEEVENT);
} |
Allocates a poll array to handle up to {@code count} events.
| KQueue::allocatePollArray | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | Apache-2.0 |
static void freePollArray(long address) {
unsafe.freeMemory(address);
} |
Free a poll array
| KQueue::freePollArray | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | Apache-2.0 |
static long getEvent(long address, int i) {
return address + (SIZEOF_KQUEUEEVENT*i);
} |
Returns kevent[i].
| KQueue::getEvent | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | Apache-2.0 |
static int getDescriptor(long address) {
return unsafe.getInt(address + OFFSET_IDENT);
} |
Returns the file descriptor from a kevent (assuming to be in ident field)
| KQueue::getDescriptor | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/KQueue.java | Apache-2.0 |
private DefaultSelectorProvider() { } |
Prevent instantiation.
| DefaultSelectorProvider::DefaultSelectorProvider | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java | Apache-2.0 |
public static SelectorProvider create() {
return new sun.nio.ch.KQueueSelectorProvider();
} |
Returns the default SelectorProvider.
| DefaultSelectorProvider::create | java | google/j2objc | jre_emul/openjdk/src/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java | Apache-2.0 |
private RoundingMode(int oldMode) {
this.oldMode = oldMode;
} |
Constructor
@param oldMode The {@code BigDecimal} constant corresponding to
this mode
| RoundingMode::RoundingMode | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/RoundingMode.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/RoundingMode.java | Apache-2.0 |
public static RoundingMode valueOf(int rm) {
switch(rm) {
case BigDecimal.ROUND_UP:
return UP;
case BigDecimal.ROUND_DOWN:
return DOWN;
case BigDecimal.ROUND_CEILING:
return CEILING;
case BigDecimal.ROUND_FLOOR:
return FLOOR;
case BigDecimal.ROUND_HALF_UP:
return HALF_UP;
case BigDecimal.ROUND_HALF_DOWN:
return HALF_DOWN;
case BigDecimal.ROUND_HALF_EVEN:
return HALF_EVEN;
case BigDecimal.ROUND_UNNECESSARY:
return UNNECESSARY;
default:
throw new IllegalArgumentException("argument out of range");
}
} |
Returns the {@code RoundingMode} object corresponding to a
legacy integer rounding mode constant in {@link BigDecimal}.
@param rm legacy integer rounding mode to convert
@return {@code RoundingMode} corresponding to the given integer.
@throws IllegalArgumentException integer is out of range
| RoundingMode::valueOf | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/RoundingMode.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/RoundingMode.java | Apache-2.0 |
private BitSieve() {
length = 150 * 64;
bits = new long[(unitIndex(length - 1) + 1)];
// Mark 1 as composite
set(0);
int nextIndex = 1;
int nextPrime = 3;
// Find primes and remove their multiples from sieve
do {
sieveSingle(length, nextIndex + nextPrime, nextPrime);
nextIndex = sieveSearch(length, nextIndex + 1);
nextPrime = 2*nextIndex + 1;
} while((nextIndex > 0) && (nextPrime < length));
} |
Construct a "small sieve" with a base of 0. This constructor is
used internally to generate the set of "small primes" whose multiples
are excluded from sieves generated by the main (package private)
constructor, BitSieve(BigInteger base, int searchLen). The length
of the sieve generated by this constructor was chosen for performance;
it controls a tradeoff between how much time is spent constructing
other sieves, and how much time is wasted testing composite candidates
for primality. The length was chosen experimentally to yield good
performance.
| BitSieve::BitSieve | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
BitSieve(BigInteger base, int searchLen) {
/*
* Candidates are indicated by clear bits in the sieve. As a candidates
* nonprimality is calculated, a bit is set in the sieve to eliminate
* it. To reduce storage space and increase efficiency, no even numbers
* are represented in the sieve (each bit in the sieve represents an
* odd number).
*/
bits = new long[(unitIndex(searchLen-1) + 1)];
length = searchLen;
int start = 0;
int step = smallSieve.sieveSearch(smallSieve.length, start);
int convertedStep = (step *2) + 1;
// Construct the large sieve at an even offset specified by base
MutableBigInteger b = new MutableBigInteger(base);
MutableBigInteger q = new MutableBigInteger();
do {
// Calculate base mod convertedStep
start = b.divideOneWord(convertedStep, q);
// Take each multiple of step out of sieve
start = convertedStep - start;
if (start%2 == 0)
start += convertedStep;
sieveSingle(searchLen, (start-1)/2, convertedStep);
// Find next prime from small sieve
step = smallSieve.sieveSearch(smallSieve.length, step+1);
convertedStep = (step *2) + 1;
} while (step > 0);
} |
Construct a bit sieve of searchLen bits used for finding prime number
candidates. The new sieve begins at the specified base, which must
be even.
| BitSieve::BitSieve | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
private static int unitIndex(int bitIndex) {
return bitIndex >>> 6;
} |
Given a bit index return unit index containing it.
| BitSieve::unitIndex | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
private static long bit(int bitIndex) {
return 1L << (bitIndex & ((1<<6) - 1));
} |
Return a unit that masks the specified bit in its unit.
| BitSieve::bit | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
private boolean get(int bitIndex) {
int unitIndex = unitIndex(bitIndex);
return ((bits[unitIndex] & bit(bitIndex)) != 0);
} |
Get the value of the bit at the specified index.
| BitSieve::get | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
private void set(int bitIndex) {
int unitIndex = unitIndex(bitIndex);
bits[unitIndex] |= bit(bitIndex);
} |
Set the bit at the specified index.
| BitSieve::set | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
private int sieveSearch(int limit, int start) {
if (start >= limit)
return -1;
int index = start;
do {
if (!get(index))
return index;
index++;
} while(index < limit-1);
return -1;
} |
This method returns the index of the first clear bit in the search
array that occurs at or after start. It will not search past the
specified limit. It returns -1 if there is no such clear bit.
| BitSieve::sieveSearch | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
private void sieveSingle(int limit, int start, int step) {
while(start < limit) {
set(start);
start += step;
}
} |
Sieve a single set of multiples out of the sieve. Begin to remove
multiples of the specified step starting at the specified start index,
up to the specified limit.
| BitSieve::sieveSingle | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
BigInteger retrieve(BigInteger initValue, int certainty, java.util.Random random) {
// Examine the sieve one long at a time to find possible primes
int offset = 1;
for (int i=0; i<bits.length; i++) {
long nextLong = ~bits[i];
for (int j=0; j<64; j++) {
if ((nextLong & 1) == 1) {
BigInteger candidate = initValue.add(
BigInteger.valueOf(offset));
if (candidate.primeToCertainty(certainty, random))
return candidate;
}
nextLong >>>= 1;
offset+=2;
}
}
return null;
} |
Test probable primes in the sieve and return successful candidates.
| BitSieve::retrieve | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | Apache-2.0 |
BigDecimal(BigInteger intVal, long val, int scale, int prec) {
this.scale = scale;
this.precision = prec;
this.intCompact = val;
this.intVal = intVal;
} |
Trusted package private constructor.
Trusted simply means if val is INFLATED, intVal could not be null and
if intVal is null, val could not be INFLATED.
| BigDecimal::BigDecimal | java | google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | https://github.com/google/j2objc/blob/master/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.