input
stringlengths
10
828
output
stringlengths
5
107
public boolean swap mu boolean b if b this return value boolean temp value value b value b value temp return value
swap values with another mutable boolean
public short divide short factor return value factor
divide by the specified factor
public short negate value short value return value
set the value to the negative of its current value
public boolean complement value value return value
set the value to its complement
public boolean accept final file dir final string name if ignore case return name to lower case starts with prefix else return name starts with prefix
check if a file is acceptible
public short complement value short value return value
set the value to its complement
public boolean and boolean b value b return value
i and i s the current value with the specified value
public boolean accept final file dir final string name if ignore case return name to lower case ends with suffix else return name ends with suffix
check if a file is acceptible
public short and short b value short value b return value
i and i s the current value with the specified value
public boolean or boolean b value b return value
i or i s the current value with the specified value
public short or short b value short value b return value
i or i s the current value with the specified value
private void check tree assert expr size 0 assert expr size q length assert expr q 0 null if size 0 assert expr q 1 null assert expr q 1 index 1 for int i 2 i size i assert expr q i null assert expr q i index i assert expr q i 1 time q i time parent fires first for int i size 1 i q length i assert expr q i null
check invariants of the queue
public short xor short b value short value b return value
i xor i s the current value with the specified value
public boolean xor boolean b value b return value
i xor i s the current value with the specified value
public void test string2 long 1 try message message sender session create message message set string property prop 0 assert equals long 0 message get long property prop catch jmsexception e fail e
if a property is set as a code java
public short shift right int bits value bits return value
shift the current value to the i right i
public int compare to boolean bool return value bool 0 value 1 1
compares this object with the specified boolean for order
public short shift right zero int bits value bits return value
shift the current value to the i right i with a zero extension
public void start if m queue thread null m queue thread start
starts the worker queue
public int compare to object obj throws class cast exception return compare to mu boolean obj value
compares this object with the specified object for order
private void check free list timeout impl to free list while to null assert expr to index timeout impl done to to next free
check invariants of the free list
public short shift left int bits value bits return value
shift the current value to the i left i
protected boolean is interrupted return m queue thread is interrupted
returns whether the worker thread has been interrupted
protected executable get job impl throws interrupted exception while the queue is empty wait when notified take an event from the queue and return it while m current job null wait this one is the job to return job item item m current job go on to the next object for the next call m current job m current job m next return item m job
never call this method only override in subclasses to perform
public int compare to short other return value other 1 value other 0 1
compares this object with the specified short for order
public boolean accept final file file if ignore case return file get name to lower case starts with prefix else return file get name starts with prefix
check if a file is acceptible
public boolean equals final object obj if obj this return true if obj null obj get class get class return counter obj count count return false
check if the given object is equal to this
protected void put job impl executable job job item posted new job item job if m current job null the queue is empty set the current job to process and wake up the thread waiting in method get job m current job posted notify all else job item item m current job the queue is not empty find the end of the queue ad add the posted job at the end while item m next null item item m next item m next posted
never call this method only override in subclasses to perform
public boolean accept final file file boolean success false for int i 0 i suffixes length success i if ignore case success file get name to lower case ends with suffixes i else success file get name ends with suffixes i return success
check if a file is acceptible
public int hash code return hash code generate value
return the hash code for this mutable boolean
public int compare to object obj return compare to mu short obj
compares this object with the specified object for order
protected void clear m queue thread null m current job null
clears the running thread after the queue has been stopped
private void swap int a int b inv assert expr a 0 inv assert expr a size inv assert expr b 0 inv assert expr b size inv assert expr q a null inv assert expr q b null inv assert expr q a index a inv assert expr q b index b timeout impl temp q a q a q b q a index a q b temp q b index b
swap two nodes in the tree
public boolean equals object obj if obj this return true if obj null obj get class get class mu boolean bool mu boolean obj return value bool value return false
test the equality of another object
public hash code add final boolean b value generate b return this
add the hash code of the given value
public double set double f double old value value f return old
set the value
public boolean commit long assumed long b boolean success assumed value if success value b return success
set the value to value only if the current value is equal to
protected runnable create queue loop return new queue loop
creates the loop that will get the next job and process it
public boolean equals final object obj if obj this return true if obj null obj get class get class soft object soft soft object obj object a this get object b soft get if a null b null return false if a b return true return a equals b return false
check the equality of an object with this
public void test string2 int 2 try message message sender session create message message set string property pi 3 14159 message get int property pi fail 3 5 4 the string to numeric conversions must throw the java lang number format exception if the numeric s value of method does not accept the string value as a valid representation n catch java lang number format exception e catch jmsexception e fail e
if a property is set as a code java
public hash code add final byte n value n return this
add the hash code of the given value
public long swap mu long b if b this return value long temp value value b value b value temp return value
swap values with another mutable long
public void set value object obj if obj instanceof mu boolean value mu boolean obj value else if obj instanceof boolean value boolean obj boolean value else if obj null value true else value false
set the value of this mutable boolean
public boolean commit double assumed double b boolean success primitives equals assumed value if success value b return success
set the value to value only if the current value is equal to
public hash code add final char n value n return this
add the hash code of the given value
private boolean normalize up int index inv assert expr index 0 inv assert expr index size inv assert expr q index null if index 1 return false at root boolean ret false long t q index time int p index 1 while q p time t inv assert expr q index time t swap p index ret true if p 1 break at root index p p 1 return ret
a new node has been added at index code index code
public byte set byte b byte old value value b return old
set the value
public long increment return value
increment the value of this mutable long
public double swap mu double b if b this return value double temp value value b value b value temp return value
swap values with another mutable double
public object get value return value boolean true boolean false
get the boolean value of this mutable boolean
public hash code add final short n value n return this
add the hash code of the given value
public char get return value
get the current value
public double add double amount return value amount
add the specified amount
public long decrement return value
decrement the value of this mutable long
public hash code add final int n value n return this
add the hash code of the given value
public boolean equals object obj if obj this return true if obj null obj get class get class return value mu short obj short value return false
test the equality of this mutable short integer and another object
public void start final boolean reset if running if reset reset start system current time millis running true
start the watch
public int compare to char other return value other 1 value other 0 1
compares this object with the specified long for order
public boolean commit byte assumed byte b boolean success assumed value if success value b return success
set the value to value only if the current value is equal to
public double subtract double amount return value amount
subtract the specified amount
public int compare to object obj return compare to mu character obj
compares this object with the specified object for order
public hash code add final long n value generate n return this
add the hash code of the given value
public long add long amount return value amount
add the specified amount
public byte swap mu byte b if b this return value byte temp value value b value b value temp return value
swap values with another mutable byte
public double multiply double factor return value factor
multiply by the specified factor
public hash code add final float f value generate f return this
add the hash code of the given value
public long stop long lap 0 if running count stop system current time millis lap stop start total lap running false return lap
stop the watch
public void test string2 int 1 try message message sender session create message message set string property prop 0 assert equals int 0 message get int property prop catch jmsexception e fail e
if a property is set as a code java
public long subtract long amount return value amount
subtract the specified amount
public boolean equals object obj if obj this return true if obj null obj get class get class return value mu character obj char value return false
test the equality of this mutable character and another object
public double divide double factor return value factor
divide by the specified factor
public byte increment return value
increment the value of this mutable byte
public void reset start 1 stop 1 total 0 count 0 running false
reset the watch
public hash code add final double f value generate f return this
add the hash code of the given value
public double negate value double value return value
set the value to the negative of its current value
public long multiply long factor return value factor
multiply by the specified factor
public void set value object obj if obj instanceof mu character value mu character obj value else if obj instanceof character value character obj char value else if obj instanceof number value char number obj int value else throw new not coercible exception can not convert to char obj
set the value of this mutable character
public byte decrement return value
decrement the value of this mutable byte
public int get lap count return count
get the i lap i count
public hash code add final object obj value generate obj return this
add the hash code of the given object
public object get value return new character value
return the char value of this mutable character
public int compare to double other return value other 1 primitives equals value other 0 1
compares this object with the specified double for order
public long divide long factor return value factor
divide by the specified factor
public long get lap time if start 1 return 0 else if running return system current time millis start else return stop start
get the elapsed i lap i time since the watch was started
public byte add byte amount return value amount
add the specified amount
public int compare to object obj return compare to mu double obj
compares this object with the specified object for order
public void create if thread safe entry map collections synchronized map new hash map else entry map new hash map now system current time millis
initializes the cache for use
public long get average lap time return count 0 0 get lap time get lap count
get the average i lap i time since the watch was started
public byte subtract byte amount return value amount
subtract the specified amount
public void check notification int result is a notification required chunk result if chunk chunk size if listener null listener on stream notification this chunk start a new chunk chunk 0
checks whether a notification is required and
public long negate value long value return value
set the value to the negative of its current value
private void do work while true timeout impl work null look for work synchronized this if size 0 try wait catch interrupted exception ex else long now system current time millis if q 1 time now try wait q 1 time now catch interrupted exception ex if size 0 q 1 time system current time millis work remove node 1 work index timeout impl timeout do work if any if work null create a new thread to do the callback timeout worker worker new timeout worker work worker start
timeout worker method
public int compare to final int other return value other 1 value other 0 1
compares this object with the specified tt int tt for order
public long get time if start 1 return 0 else if running return total system current time millis start else return total
get the elapsed time since the watch was created or last reset
public byte multiply byte factor return value factor
multiply by the specified factor
public void test string2 short 2 try message message sender session create message message set string property pi 3 14159 message get short property pi fail 3 5 4 the string to numeric conversions must throw the java lang number format exception if the numeric s value of method does not accept the string value as a valid representation n catch java lang number format exception e catch jmsexception e fail e
if a property is set as a code java
public long complement value long value return value
set the value to its complement
public int compare to final object obj throws class cast exception hash code hash code hash code obj return compare to hash code value
compares this object with the specified object for order
public boolean equals object obj if obj this return true if obj null obj get class get class return primitives equals value mu double obj double value return false
test the equality of this mutable double with another object
public byte divide byte factor return value factor
divide by the specified factor