input
stringlengths
10
828
output
stringlengths
5
107
public void update for player p player map values p set active false shots clear shots for list d holder lists d clear hud update
clears all in game objects so that they are refreshed each frame
public abstract block create block int num int x int y return null
creates a block with the specified position
private void net start udpbuffer out out clear out put byte pkt shape out put string ship to string out put byte pkt play put power out power put power s out power put turn speed out turn speed put turn speed s out turn speed put turn resistance out turn resistance put turn resistance s out turn resistance put display out put motdrequest out put fpsrequest out max fps out flip send packet out
try to send a start play packet to the server and get an
private void check wrap utilities wrap line map get width map get height connector shape utilities wrap line map get width map get height view x view y connector shape utilities wrap line map get width map get height connector shape system out println wrapping connector
makes sure that the connector is wrapped properly
private void set color color enemy color
sets the shots color to enemy color white
public void net turn speed short new speed this new speed turn speed
changes the turnspeed
public void quit quit true send quit
stops input loop and sends quit packets
protected class reliable processor implements packet processor override public void process packet byte buffer in throws packet read exception reliable data error error reliable read reliable data in net client this reliable buf if print packets system out println error reliable count system out println count reliable count size reliable get len
processes reliable packets
public int get k return this k
returns the minimum threshold size
public int get l return this l
returns the group size
public big integer get modulus return this n
returns the group key modulus
public big integer get exponent return this e
returns the group key exponent
public big integer get sig return this sig
return a big integer representation of this signature
public verifier get sig verifier return this sig verifier
return this signatures verifier
public group key get group key throws threshold sig exception check key init return this gk
returns the group key
public otp erlang object get old value return old value
returns the old value stored in scalaris
public int size return results arity
gets the number of results in the list
public boolean bool value throws class cast exception if value equals common erlang objects false atom return false else if value equals common erlang objects true atom return true else throw new class cast exception no boolean
returns the java int value of the wrapped erlang value
public void node fail reset peer node node synchronized node if node get failure count 0 a previously failed node must be in bad nodes move it back to good nodes bad nodes remove node node reset failure count good nodes add node
acts upon a failure reset of the given node
protected string convert scalaris jsonto java key final otp erlang object key erl throws class cast exception if key erl instanceof otp erlang atom return otp erlang atom key erl atom value else try return erlang value otp object to string key erl catch final class cast exception e throw new class cast exception unsupported json key key erl to string e get message
converts the given scalaris erlang object as part of an objects key to
public int int value throws class cast exception try return otp erlang long value int value catch final otp erlang range exception e throw new class cast exception cannot cast to int value is too big use long value or big int value instead
returns the java int value of the wrapped erlang value
public void available node added final peer node new node
signals the connection policy that the given node has been added to the
public void available node removed final peer node removed node
signals the connection policy that the given node has been removed from
public long long value throws class cast exception final otp erlang long long value otp erlang long value if long value is long return long value long value else throw new class cast exception cannot cast to long value is too big use big int value instead
returns the java long value of the wrapped erlang value
public void available nodes reset
signals the connection policy that the list of available nodes has been
public void node failed final peer node node synchronized node node set last failed connect
acts upon a failure of the given node
public void node fail reset final peer node node synchronized node node reset failure count
acts upon a failure reset of the given node
public void node connect success final peer node node synchronized node node reset failure count node set last connect success
acts upon a successful connect attempt of the given node
public peer node select node throws unsupported operation exception try return select node 0 null null catch final unsupported operation exception e throw e catch final exception e this should not happen select node should be able to copy with this situation without throwing another exception than unsupported operation exception throw new internal error
selects the node to connect with when establishing a connection no
public big integer big int value throws class cast exception return otp erlang long value big integer value
returns the java big integer value of the wrapped erlang value
public double double value throws class cast exception return otp erlang double value double value
returns the java double value of the wrapped erlang value
public string string value throws class cast exception return otp object to string value
returns the java
public delete result get last delete result throws unknown exception try return new delete result last delete result catch final unknown exception e throw new unknown exception e last delete result
returns the result of the last call to
public void close connection connection close
closes the transactions connection to a scalaris node
private method get setter for final string key final type type final string key cap1st cap first key final string set method set key cap1st final class class get raw type type try return c get method set method class catch final exception e throw new class cast exception no setter set method class get simple name e get message
uses introspection to get the setter method for the given key of class
public otp peer get node return node
gets the otp node that is being wrapped
synchronized public date get last failed connect return last failed connection
gets the date of the last failed connection
synchronized public date get last connect success return last connect success
gets the date of the last successful connection
private type get type of final string key throws class cast exception final string key cap1st cap first key try try return c get method get key cap1st get generic return type catch final no such method exception e return c get method is key cap1st get generic return type catch final exception e throw new class cast exception no getter get is key cap1st e get message
uses introspection to get the type of the given key of class
public void commit throws connection exception timeout exception abort exception unknown exception req list request list new request list add commit
commits the current transaction
public void abort trans log null
cancels the current transaction
final protected void test begin time at start system current time millis
call this method when a benchmark is started
final protected long test end final int test runs final long time taken system current time millis time at start final long speed test runs 1000 time taken return speed
call this method when a benchmark is finished
public otp erlang object value return value
gets the original erlang value
protected void pre init throws exception
will be called before the benchmark starts
public void set properties final properties properties final string nodes temp properties get property scalaris node node1 localhost split s nodes clear for int i 0 i nodes temp length i add node fix localhost name nodes temp i cookie properties get property scalaris cookie chocolate chip cookie client name properties get property scalaris client name java client if properties get property scalaris client append uuid true equals true client name append uuid true else client name append uuid false config file used properties get property property loader loadedfile system out println node node
sets the objects members used for creating connections to erlang to
public otp self get self return self
gets the local node used for the connection
public peer node get remote return remote
gets the remote node connected to
public otp connection get connection return connection
gets the encapsulated otp connection object
public connection create connection throws connection exception return create connection client name
creates a connection to a scalaris erlang node specified by the given
public request list add commit throws unsupported operation exception if is commit throw new unsupported operation exception only one commit per request list allowed final otp erlang tuple req common erlang objects commit tuple atom requests add req is commit true return this
adds a commit operation to the list of requests
public boolean is empty return requests is empty
checks whether the request list is empty
public int size return requests size
gets the number of requests in the list
public void print properties final print stream out out println connection factory properties out println config file config file used out println scalaris node nodes to string out println scalaris cookie cookie out println scalaris client name client name out println scalaris client append uuid client name append uuid
prints the objects properties to the given output stream
public void set node final string node this nodes clear connection policy available nodes reset add node node
sets the name of the node to connect to
public void shutdown vm throws connection exception connection send rpc api vm shutdown vm new otp erlang object
tells the scalaris vm of the current connection to shut down gracefully
public void add node final string node final peer node p new peer node node this nodes add p connection policy available node added p
adds a node to the set of nodes available for connections
public void kill vm throws connection exception connection send rpc api vm kill vm new otp erlang object
kills the scalaris vm of the current connection
public void remove node final peer node node this nodes remove node connection policy available node removed node
removes a node from the set of nodes available for connections
public void set cookie final string cookie this cookie cookie
sets the cookie name to use for connections
public void set client name final string client name this client name client name
sets the name of the java client to use when establishing a connection
public boolean is client name append uuid return client name append uuid
returns whether an uuid is appended to client names or not
public void set client name append uuid final boolean client name append uuid this client name append uuid client name append uuid
sets whether to append an uuid to client names or not
public void set connection policy final connection policy connection policy this connection policy connection policy
sets the connection policy to use for new connections
public connection policy get connection policy return connection policy
gets the current connection policy
public boolean is minor return minor
gets whether the change is a minor change or not
public int update page lists prepare read transaction request list read requests get page list key key gen string title int ops 0 read old and new page lists for set string cur list changes for string name cur list read requests add read key gen get page list key name ops return ops
adds read operations to the given request list as required by
public revision get cur rev return cur rev
gets the current revision
public void set cur rev revision cur rev this cur rev cur rev
sets the current revision
public void set restrictions map string string restrictions this restrictions restrictions
sets page restrictions
public boolean check edit allowed string username system out println result page get restrictions string all restrictions get all if all null all equals username return false string edit restrictions get edit if edit null edit equals username return false return true
checks if a user is allows to edit the given page
public void set sitename string sitename this sitename sitename
sets the sites name
public void set generator string generator this generator generator
sets the sites generator media wiki version string
public void set namespaces map string map string string namespaces this namespaces namespaces
sets the namespace mapping
public string get case return case str
gets the case option of the site
public void set case string case str this case str case str
sets the case option of the site
public save result update page lists check writes transaction result list write results get page list key key gen string title int first op beware keep order of operations in sync with read page lists prepare evaluate results changing the old and new page lists for set string cur list changes for string name cur list try write results process write at first op catch exception e return new save result false unknown exception updating key gen get page list key name in scalaris e get message return new save result
checks whether all writes from
public void end revision string uri string local name string q name final revision new revision integer parse int id timestamp minor change current contributor get contributor comment text
called to when an ending revision element is encountered
public void end contributor string uri string local name string q name system out println ip ip user user id id final contributor new contributor final contributor set ip ip if id is empty final contributor set id integer parse int id final contributor set user user
called to when an ending contributor element is encountered
public void characters char ch int start int length system out println new string ch start length current string append ch start length
called to process character data
public void end site info string uri string local name string q name final siteinfo new site info base sitename generator case str namespaces
called to when an ending siteinfo element is encountered
public void end element string uri string local name string q name if local name equals sitename sitename current string to string else if local name equals base base current string to string else if local name equals generator generator current string to string else if local name equals case case str current string to string else if local name equals namespaces in site info namespaces false else if local name equals namespace current namespace put site info namespace prefix current string to string namespaces put current namespace key current namespace
called to when an ending element is encountered
protected void export contributor contributor if contributor get ip equals system out print user contributor get id wiki dump to stdout handler escape contributor get user else system out print ip contributor get ip
dumps the given contributor to the standard output in the following text
public boolean is not available return not available
returns whether the originally requested page is available
public void set not available boolean not available this not available not available
sets that the originally requested page is not available
final protected void import start time at start system current time millis
sets the time the import started
public string get redirect content string page name revision result get rev result scalaris data handler get revision connection page name if get rev result success make pagename in the redirected content work as expected set page name page name return get rev result revision get text else system err println get rev result message return b error redirect to get redirect link failed get rev result message b return 35 redirect page name
gets the contents of the newest revision of the page redirected to
final protected void import end time at end system current time millis
sets the time the import finished
public long get time at start return time at start
gets the time the import started
public string get image base url return f external image base url
gets the base url for images can contain image for replacement
public long get time at end return time at end
gets the time the import finished
private boolean check subscribers otp erlang list list string subscriber for int i 0 i list arity i if otp erlang string list element at i string value equals subscriber return true return false
checks if the given subscriber exists in the given list
public string get link base url return f external wiki base url
gets the base url for links can contain title for replacement
public string get link base full url return f external wiki base full url
gets the base url for full links including http can contain title
public void set msg out print stream msg out this msg out msg out
sets the output writer to write status messages to defaults to
public void set link base full url string link base full url this f external wiki base full url link base full url
sets the base url for full links including http can contain title
public void stop parsing this stop true
tells the parser to stop at the next starting element
private string get ns pref integer key return siteinfo get namespaces get key to string get site info namespace prefix
gets the namespace prefix of the given key
private boolean check subscribers list string list string subscriber return list contains subscriber
checks if the given subscriber exists in the given list
public string format statistic number boolean raw number number number if raw number return number to string else todo use locale from wiki number format nf number format get number instance locale english nf set grouping used true return nf format number
formats the given number using the wikis locale