id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
41,100
naver/android-utilset
UtilSet/src/com/navercorp/utilset/device/DeviceTypeDetector.java
DeviceTypeDetector.getDeviceType
public DeviceType getDeviceType(Context activityContext) { // Verifies if the Generalized Size of the device is XLARGE to be // considered a Tablet boolean xlarge = ((activityContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == SCREENLAYOUT_SIZE_XLARGE); // If XLarg...
java
public DeviceType getDeviceType(Context activityContext) { // Verifies if the Generalized Size of the device is XLARGE to be // considered a Tablet boolean xlarge = ((activityContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == SCREENLAYOUT_SIZE_XLARGE); // If XLarg...
[ "public", "DeviceType", "getDeviceType", "(", "Context", "activityContext", ")", "{", "// Verifies if the Generalized Size of the device is XLARGE to be", "// considered a Tablet", "boolean", "xlarge", "=", "(", "(", "activityContext", ".", "getResources", "(", ")", ".", "g...
Checks if the device is a tablet or a phone @param activityContext The Activity Context. @return Returns true if the device is a Tablet
[ "Checks", "if", "the", "device", "is", "a", "tablet", "or", "a", "phone" ]
4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b
https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/device/DeviceTypeDetector.java#L25-L52
41,101
naver/android-utilset
UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java
VolumeUtils.getCurrentVolume
public static int getCurrentVolume(Context context) { AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); return mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); }
java
public static int getCurrentVolume(Context context) { AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); return mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); }
[ "public", "static", "int", "getCurrentVolume", "(", "Context", "context", ")", "{", "AudioManager", "mAudioManager", "=", "(", "AudioManager", ")", "context", ".", "getSystemService", "(", "Context", ".", "AUDIO_SERVICE", ")", ";", "return", "mAudioManager", ".", ...
Returns current media volume @param context @return current volume
[ "Returns", "current", "media", "volume" ]
4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b
https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java#L20-L23
41,102
naver/android-utilset
UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java
VolumeUtils.getMaximumVolume
public static int getMaximumVolume(Context context) { return ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).getStreamMaxVolume(AudioManager.STREAM_MUSIC); }
java
public static int getMaximumVolume(Context context) { return ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).getStreamMaxVolume(AudioManager.STREAM_MUSIC); }
[ "public", "static", "int", "getMaximumVolume", "(", "Context", "context", ")", "{", "return", "(", "(", "AudioManager", ")", "context", ".", "getSystemService", "(", "Context", ".", "AUDIO_SERVICE", ")", ")", ".", "getStreamMaxVolume", "(", "AudioManager", ".", ...
Returns maximum volume the media volume can have @param context Context @return Maximum volume
[ "Returns", "maximum", "volume", "the", "media", "volume", "can", "have" ]
4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b
https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java#L90-L92
41,103
naver/android-utilset
UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java
NetworkMonitor.registerConnectivityReceiver
private void registerConnectivityReceiver() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); context.registerReceiver(connectivityReceiver, intentFilter); }
java
private void registerConnectivityReceiver() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); context.registerReceiver(connectivityReceiver, intentFilter); }
[ "private", "void", "registerConnectivityReceiver", "(", ")", "{", "IntentFilter", "intentFilter", "=", "new", "IntentFilter", "(", ")", ";", "intentFilter", ".", "addAction", "(", "ConnectivityManager", ".", "CONNECTIVITY_ACTION", ")", ";", "context", ".", "register...
Registers receiver to be notified of broadcast event when network connection changes
[ "Registers", "receiver", "to", "be", "notified", "of", "broadcast", "event", "when", "network", "connection", "changes" ]
4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b
https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java#L246-L250
41,104
naver/android-utilset
UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java
NetworkMonitor.isWifiFake
public boolean isWifiFake(String ipAddress, int port) { SocketChannel socketChannel = null; try { socketChannel = SocketChannel.open(); socketChannel.connect(new InetSocketAddress(ipAddress, port)); } catch (IOException e) { Log.d(TAG, "Current Wifi is stupid!!! by IOException"); return true; } catc...
java
public boolean isWifiFake(String ipAddress, int port) { SocketChannel socketChannel = null; try { socketChannel = SocketChannel.open(); socketChannel.connect(new InetSocketAddress(ipAddress, port)); } catch (IOException e) { Log.d(TAG, "Current Wifi is stupid!!! by IOException"); return true; } catc...
[ "public", "boolean", "isWifiFake", "(", "String", "ipAddress", ",", "int", "port", ")", "{", "SocketChannel", "socketChannel", "=", "null", ";", "try", "{", "socketChannel", "=", "SocketChannel", ".", "open", "(", ")", ";", "socketChannel", ".", "connect", "...
Checks if currently connected Access Point is either rogue or incapable of routing packet @param ipAddress Any valid IP addresses will work to check if the device is connected to properly working AP @param port Port number bound with ipAddress parameter @return true if currently connected AP is not working normally; f...
[ "Checks", "if", "currently", "connected", "Access", "Point", "is", "either", "rogue", "or", "incapable", "of", "routing", "packet" ]
4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b
https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java#L756-L776
41,105
hayribakici/infiniteviewpager
infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java
InfinitePagerAdapter.instantiateItem
@Override public final Object instantiateItem(final ViewGroup container, final int position) { if (Constants.DEBUG) { Log.i("InfiniteViewPager", String.format("instantiating position %s", position)); } final PageModel<T> model = createPageModel(position); mPageModels[posi...
java
@Override public final Object instantiateItem(final ViewGroup container, final int position) { if (Constants.DEBUG) { Log.i("InfiniteViewPager", String.format("instantiating position %s", position)); } final PageModel<T> model = createPageModel(position); mPageModels[posi...
[ "@", "Override", "public", "final", "Object", "instantiateItem", "(", "final", "ViewGroup", "container", ",", "final", "int", "position", ")", "{", "if", "(", "Constants", ".", "DEBUG", ")", "{", "Log", ".", "i", "(", "\"InfiniteViewPager\"", ",", "String", ...
This method is only called, when this pagerAdapter is initialized.
[ "This", "method", "is", "only", "called", "when", "this", "pagerAdapter", "is", "initialized", "." ]
cb3ca2a3833bbb3aeef02b9693787987b970bb89
https://github.com/hayribakici/infiniteviewpager/blob/cb3ca2a3833bbb3aeef02b9693787987b970bb89/infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java#L63-L72
41,106
hayribakici/infiniteviewpager
infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java
InfinitePagerAdapter.printPageModels
private void printPageModels(final String tag) { for (int i = 0; i < PAGE_COUNT; i++) { printPageModel(tag, mPageModels[i], i); } }
java
private void printPageModels(final String tag) { for (int i = 0; i < PAGE_COUNT; i++) { printPageModel(tag, mPageModels[i], i); } }
[ "private", "void", "printPageModels", "(", "final", "String", "tag", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "PAGE_COUNT", ";", "i", "++", ")", "{", "printPageModel", "(", "tag", ",", "mPageModels", "[", "i", "]", ",", "i", ")", ...
Debug related methods
[ "Debug", "related", "methods" ]
cb3ca2a3833bbb3aeef02b9693787987b970bb89
https://github.com/hayribakici/infiniteviewpager/blob/cb3ca2a3833bbb3aeef02b9693787987b970bb89/infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java#L239-L243
41,107
davidmoten/grumpy
grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
Position.predict
public final Position predict(double distanceKm, double courseDegrees) { assertWithMsg(alt == 0.0, "Predictions only valid for Earth's surface"); double dr = distanceKm / EARTH_RADIUS_KM; double latR = toRadians(lat); double lonR = toRadians(lon); double courseR = toRadians(cours...
java
public final Position predict(double distanceKm, double courseDegrees) { assertWithMsg(alt == 0.0, "Predictions only valid for Earth's surface"); double dr = distanceKm / EARTH_RADIUS_KM; double latR = toRadians(lat); double lonR = toRadians(lon); double courseR = toRadians(cours...
[ "public", "final", "Position", "predict", "(", "double", "distanceKm", ",", "double", "courseDegrees", ")", "{", "assertWithMsg", "(", "alt", "==", "0.0", ",", "\"Predictions only valid for Earth's surface\"", ")", ";", "double", "dr", "=", "distanceKm", "/", "EAR...
Predicts position travelling along a great circle arc based on the Haversine formula. From http://www.movable-type.co.uk/scripts/latlong.html @param distanceKm @param courseDegrees @return
[ "Predicts", "position", "travelling", "along", "a", "great", "circle", "arc", "based", "on", "the", "Haversine", "formula", "." ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L104-L115
41,108
davidmoten/grumpy
grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
Position.getBearingDegrees
public final double getBearingDegrees(Position position) { double lat1 = toRadians(lat); double lat2 = toRadians(position.lat); double lon1 = toRadians(lon); double lon2 = toRadians(position.lon); double dLon = lon2 - lon1; double sinDLon = sin(dLon); double cosLa...
java
public final double getBearingDegrees(Position position) { double lat1 = toRadians(lat); double lat2 = toRadians(position.lat); double lon1 = toRadians(lon); double lon2 = toRadians(position.lon); double dLon = lon2 - lon1; double sinDLon = sin(dLon); double cosLa...
[ "public", "final", "double", "getBearingDegrees", "(", "Position", "position", ")", "{", "double", "lat1", "=", "toRadians", "(", "lat", ")", ";", "double", "lat2", "=", "toRadians", "(", "position", ".", "lat", ")", ";", "double", "lon1", "=", "toRadians"...
Returns a great circle bearing in degrees in the range 0 to 360. @param position @return
[ "Returns", "a", "great", "circle", "bearing", "in", "degrees", "in", "the", "range", "0", "to", "360", "." ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L290-L304
41,109
davidmoten/grumpy
grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
Position.getBearingDifferenceDegrees
public static double getBearingDifferenceDegrees(double bearing1, double bearing2) { if (bearing1 < 0) bearing1 += 360; if (bearing2 > 180) bearing2 -= 360; double result = bearing1 - bearing2; if (result > 180) result -= 360; return result; ...
java
public static double getBearingDifferenceDegrees(double bearing1, double bearing2) { if (bearing1 < 0) bearing1 += 360; if (bearing2 > 180) bearing2 -= 360; double result = bearing1 - bearing2; if (result > 180) result -= 360; return result; ...
[ "public", "static", "double", "getBearingDifferenceDegrees", "(", "double", "bearing1", ",", "double", "bearing2", ")", "{", "if", "(", "bearing1", "<", "0", ")", "bearing1", "+=", "360", ";", "if", "(", "bearing2", ">", "180", ")", "bearing2", "-=", "360"...
returns difference in degrees in the range -180 to 180 @param bearing1 degrees between -360 and 360 @param bearing2 degrees between -360 and 360 @return
[ "returns", "difference", "in", "degrees", "in", "the", "range", "-", "180", "to", "180" ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L315-L324
41,110
davidmoten/grumpy
grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
Position.getPositionAlongPath
public final Position getPositionAlongPath(Position position, double proportion) { if (proportion >= 0 && proportion <= 1) { // Get bearing degrees for course double courseDegrees = this.getBearingDegrees(position); // Get distance from position arg and this objects locati...
java
public final Position getPositionAlongPath(Position position, double proportion) { if (proportion >= 0 && proportion <= 1) { // Get bearing degrees for course double courseDegrees = this.getBearingDegrees(position); // Get distance from position arg and this objects locati...
[ "public", "final", "Position", "getPositionAlongPath", "(", "Position", "position", ",", "double", "proportion", ")", "{", "if", "(", "proportion", ">=", "0", "&&", "proportion", "<=", "1", ")", "{", "// Get bearing degrees for course", "double", "courseDegrees", ...
Returns a position along a path according to the proportion value @param position @param proportion is between 0 and 1 inclusive @return
[ "Returns", "a", "position", "along", "a", "path", "according", "to", "the", "proportion", "value" ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L387-L405
41,111
davidmoten/grumpy
grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
Position.longitudeDiff
public static double longitudeDiff(double a, double b) { a = to180(a); b = to180(b); return Math.abs(to180(a - b)); }
java
public static double longitudeDiff(double a, double b) { a = to180(a); b = to180(b); return Math.abs(to180(a - b)); }
[ "public", "static", "double", "longitudeDiff", "(", "double", "a", ",", "double", "b", ")", "{", "a", "=", "to180", "(", "a", ")", ";", "b", "=", "to180", "(", "b", ")", ";", "return", "Math", ".", "abs", "(", "to180", "(", "a", "-", "b", ")", ...
Returns the difference between two longitude values. The returned value is always >=0. @param a @param b @return
[ "Returns", "the", "difference", "between", "two", "longitude", "values", ".", "The", "returned", "value", "is", "always", ">", "=", "0", "." ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L568-L572
41,112
davidmoten/grumpy
grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
Position.to180
public static double to180(double d) { if (d < 0) return -to180(abs(d)); else { if (d > 180) { long n = round(floor((d + 180) / 360.0)); return d - n * 360; } else return d; } }
java
public static double to180(double d) { if (d < 0) return -to180(abs(d)); else { if (d > 180) { long n = round(floor((d + 180) / 360.0)); return d - n * 360; } else return d; } }
[ "public", "static", "double", "to180", "(", "double", "d", ")", "{", "if", "(", "d", "<", "0", ")", "return", "-", "to180", "(", "abs", "(", "d", ")", ")", ";", "else", "{", "if", "(", "d", ">", "180", ")", "{", "long", "n", "=", "round", "...
Converts an angle in degrees to range -180< x <= 180. @param d @return
[ "Converts", "an", "angle", "in", "degrees", "to", "range", "-", "180<", "x", "<", "=", "180", "." ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L580-L590
41,113
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsServer.java
PresentsServer.runServer
public static void runServer (Module... modules) { Injector injector = Guice.createInjector(modules); PresentsServer server = injector.getInstance(PresentsServer.class); try { // initialize the server server.init(injector); // check to see if we should lo...
java
public static void runServer (Module... modules) { Injector injector = Guice.createInjector(modules); PresentsServer server = injector.getInstance(PresentsServer.class); try { // initialize the server server.init(injector); // check to see if we should lo...
[ "public", "static", "void", "runServer", "(", "Module", "...", "modules", ")", "{", "Injector", "injector", "=", "Guice", ".", "createInjector", "(", "modules", ")", ";", "PresentsServer", "server", "=", "injector", ".", "getInstance", "(", "PresentsServer", "...
Inits and runs the PresentsServer bound in the given modules. This blocks until the server is shut down.
[ "Inits", "and", "runs", "the", "PresentsServer", "bound", "in", "the", "given", "modules", ".", "This", "blocks", "until", "the", "server", "is", "shut", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsServer.java#L118-L147
41,114
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsServer.java
PresentsServer.run
public void run () { // wait till everything in the dobjmgr queue and invokers are processed and then start the // connection manager ((PresentsInvoker)_invoker).postRunnableWhenEmpty(new Runnable() { public void run () { // Take as long as you like opening to the...
java
public void run () { // wait till everything in the dobjmgr queue and invokers are processed and then start the // connection manager ((PresentsInvoker)_invoker).postRunnableWhenEmpty(new Runnable() { public void run () { // Take as long as you like opening to the...
[ "public", "void", "run", "(", ")", "{", "// wait till everything in the dobjmgr queue and invokers are processed and then start the", "// connection manager", "(", "(", "PresentsInvoker", ")", "_invoker", ")", ".", "postRunnableWhenEmpty", "(", "new", "Runnable", "(", ")", ...
Starts up all of the server services and enters the main server event loop.
[ "Starts", "up", "all", "of", "the", "server", "services", "and", "enters", "the", "main", "server", "event", "loop", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsServer.java#L229-L245
41,115
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsServer.java
PresentsServer.openToThePublic
protected void openToThePublic () { if (getListenPorts().length != 0 && !_socketAcceptor.bind()) { queueShutdown(); } else { _datagramReader.bind(); _conmgr.start(); } }
java
protected void openToThePublic () { if (getListenPorts().length != 0 && !_socketAcceptor.bind()) { queueShutdown(); } else { _datagramReader.bind(); _conmgr.start(); } }
[ "protected", "void", "openToThePublic", "(", ")", "{", "if", "(", "getListenPorts", "(", ")", ".", "length", "!=", "0", "&&", "!", "_socketAcceptor", ".", "bind", "(", ")", ")", "{", "queueShutdown", "(", ")", ";", "}", "else", "{", "_datagramReader", ...
Opens the server for connections after the event thread is running and all the invokers are clear after starting up.
[ "Opens", "the", "server", "for", "connections", "after", "the", "event", "thread", "is", "running", "and", "all", "the", "invokers", "are", "clear", "after", "starting", "up", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsServer.java#L251-L259
41,116
threerings/narya
tools/src/main/java/com/threerings/presents/tools/SourceFile.java
SourceFile.readFrom
public void readFrom (File source) throws IOException { // slurp our source file into newline separated strings _lines = Lists.newArrayList(); BufferedReader bin = new BufferedReader(new FileReader(source)); String line = null; while ((line = bin.readLine()) != null) ...
java
public void readFrom (File source) throws IOException { // slurp our source file into newline separated strings _lines = Lists.newArrayList(); BufferedReader bin = new BufferedReader(new FileReader(source)); String line = null; while ((line = bin.readLine()) != null) ...
[ "public", "void", "readFrom", "(", "File", "source", ")", "throws", "IOException", "{", "// slurp our source file into newline separated strings", "_lines", "=", "Lists", ".", "newArrayList", "(", ")", ";", "BufferedReader", "bin", "=", "new", "BufferedReader", "(", ...
Reads the code from the supplied source file.
[ "Reads", "the", "code", "from", "the", "supplied", "source", "file", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/SourceFile.java#L46-L109
41,117
threerings/narya
tools/src/main/java/com/threerings/presents/tools/SourceFile.java
SourceFile.containsString
public boolean containsString (String text) { for (int ii = 0, nn = _lines.size(); ii < nn; ii++) { // don't look inside the autogenerated areas if (!(ii >= _nstart && ii < _nend) && !(ii >= _mstart && ii < _mend) && _lines.get(ii).contains(text)) { ...
java
public boolean containsString (String text) { for (int ii = 0, nn = _lines.size(); ii < nn; ii++) { // don't look inside the autogenerated areas if (!(ii >= _nstart && ii < _nend) && !(ii >= _mstart && ii < _mend) && _lines.get(ii).contains(text)) { ...
[ "public", "boolean", "containsString", "(", "String", "text", ")", "{", "for", "(", "int", "ii", "=", "0", ",", "nn", "=", "_lines", ".", "size", "(", ")", ";", "ii", "<", "nn", ";", "ii", "++", ")", "{", "// don't look inside the autogenerated areas", ...
Returns true if the supplied text appears in the non-auto-generated section.
[ "Returns", "true", "if", "the", "supplied", "text", "appears", "in", "the", "non", "-", "auto", "-", "generated", "section", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/SourceFile.java#L114-L124
41,118
threerings/narya
tools/src/main/java/com/threerings/presents/tools/SourceFile.java
SourceFile.generate
public String generate (String fsection, String msection) throws IOException { StringWriter writer = new StringWriter(); BufferedWriter bout = new BufferedWriter(writer); addOrRemoveGeneratedImport(StringUtil.deNull(fsection).contains("@Generated(") || StringUtil.deNull(m...
java
public String generate (String fsection, String msection) throws IOException { StringWriter writer = new StringWriter(); BufferedWriter bout = new BufferedWriter(writer); addOrRemoveGeneratedImport(StringUtil.deNull(fsection).contains("@Generated(") || StringUtil.deNull(m...
[ "public", "String", "generate", "(", "String", "fsection", ",", "String", "msection", ")", "throws", "IOException", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "BufferedWriter", "bout", "=", "new", "BufferedWriter", "(", "writer", ...
Writes the code out to the specified file. @param fsection the new "generated fields" to write to the file, or null. @param msection the new "generated methods" to write to the file, or null.
[ "Writes", "the", "code", "out", "to", "the", "specified", "file", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/SourceFile.java#L132-L184
41,119
threerings/narya
tools/src/main/java/com/threerings/presents/tools/SourceFile.java
SourceFile.check
protected void check (File source, String mname, int mline, String fname, int fline) throws IOException { if (mline == -1 && fline != -1) { throw new IOException( "Found " + fname + " marker (at line " + (fline+1) + ") but no " + mname + " marker in '" + s...
java
protected void check (File source, String mname, int mline, String fname, int fline) throws IOException { if (mline == -1 && fline != -1) { throw new IOException( "Found " + fname + " marker (at line " + (fline+1) + ") but no " + mname + " marker in '" + s...
[ "protected", "void", "check", "(", "File", "source", ",", "String", "mname", ",", "int", "mline", ",", "String", "fname", ",", "int", "fline", ")", "throws", "IOException", "{", "if", "(", "mline", "==", "-", "1", "&&", "fline", "!=", "-", "1", ")", ...
Helper function for sanity checking marker existence.
[ "Helper", "function", "for", "sanity", "checking", "marker", "existence", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/SourceFile.java#L187-L195
41,120
threerings/narya
tools/src/main/java/com/threerings/presents/tools/SourceFile.java
SourceFile.writeln
protected void writeln (BufferedWriter bout, String line) throws IOException { bout.write(line); bout.newLine(); }
java
protected void writeln (BufferedWriter bout, String line) throws IOException { bout.write(line); bout.newLine(); }
[ "protected", "void", "writeln", "(", "BufferedWriter", "bout", ",", "String", "line", ")", "throws", "IOException", "{", "bout", ".", "write", "(", "line", ")", ";", "bout", ".", "newLine", "(", ")", ";", "}" ]
Helper function for writing a string and a newline to a writer.
[ "Helper", "function", "for", "writing", "a", "string", "and", "a", "newline", "to", "a", "writer", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/SourceFile.java#L205-L210
41,121
threerings/narya
tools/src/main/java/com/threerings/presents/tools/SourceFile.java
SourceFile.addOrRemoveGeneratedImport
protected void addOrRemoveGeneratedImport (boolean add) { final String IMPORT = "import javax.annotation.Generated;"; int packageLine = -1; int importLine = -1; int lastJavaImport = -1; int firstNonJavaImport = -1; for (int ii = 0, nn = _lines.size(); ii < nn; ii++) ...
java
protected void addOrRemoveGeneratedImport (boolean add) { final String IMPORT = "import javax.annotation.Generated;"; int packageLine = -1; int importLine = -1; int lastJavaImport = -1; int firstNonJavaImport = -1; for (int ii = 0, nn = _lines.size(); ii < nn; ii++) ...
[ "protected", "void", "addOrRemoveGeneratedImport", "(", "boolean", "add", ")", "{", "final", "String", "IMPORT", "=", "\"import javax.annotation.Generated;\"", ";", "int", "packageLine", "=", "-", "1", ";", "int", "importLine", "=", "-", "1", ";", "int", "lastJa...
Add or remove an import for "@Generated", if needed.
[ "Add", "or", "remove", "an", "import", "for" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/SourceFile.java#L215-L262
41,122
threerings/narya
core/src/main/java/com/threerings/admin/client/FieldEditor.java
FieldEditor.updateBorder
protected void updateBorder (boolean modified) { if (modified) { setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.red)); } else { setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); } }
java
protected void updateBorder (boolean modified) { if (modified) { setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.red)); } else { setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); } }
[ "protected", "void", "updateBorder", "(", "boolean", "modified", ")", "{", "if", "(", "modified", ")", "{", "setBorder", "(", "BorderFactory", ".", "createMatteBorder", "(", "2", ",", "2", ",", "2", ",", "2", ",", "Color", ".", "red", ")", ")", ";", ...
Sets the appropriate border on this field editor based on whether or not the field is modified.
[ "Sets", "the", "appropriate", "border", "on", "this", "field", "editor", "based", "on", "whether", "or", "not", "the", "field", "is", "modified", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/client/FieldEditor.java#L185-L192
41,123
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.addListener
public void addListener (ChangeListener listener, boolean weak) { // only add the listener if they're not already there int idx = getListenerIndex(listener); if (idx == -1) { _listeners = ListUtil.add(_listeners, weak ? new WeakReference<Object>(listener) : listen...
java
public void addListener (ChangeListener listener, boolean weak) { // only add the listener if they're not already there int idx = getListenerIndex(listener); if (idx == -1) { _listeners = ListUtil.add(_listeners, weak ? new WeakReference<Object>(listener) : listen...
[ "public", "void", "addListener", "(", "ChangeListener", "listener", ",", "boolean", "weak", ")", "{", "// only add the listener if they're not already there", "int", "idx", "=", "getListenerIndex", "(", "listener", ")", ";", "if", "(", "idx", "==", "-", "1", ")", ...
Adds an event listener to this object. The listener will be notified when any events are dispatched on this object that match their particular listener interface. <p> Note that the entity adding itself as a listener should have obtained the object reference by subscribing to it or should be acting on behalf of some ot...
[ "Adds", "an", "event", "listener", "to", "this", "object", ".", "The", "listener", "will", "be", "notified", "when", "any", "events", "are", "dispatched", "on", "this", "object", "that", "match", "their", "particular", "listener", "interface", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L201-L219
41,124
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.removeListener
public void removeListener (ChangeListener listener) { int idx = getListenerIndex(listener); if (idx != -1) { _listeners[idx] = null; } }
java
public void removeListener (ChangeListener listener) { int idx = getListenerIndex(listener); if (idx != -1) { _listeners[idx] = null; } }
[ "public", "void", "removeListener", "(", "ChangeListener", "listener", ")", "{", "int", "idx", "=", "getListenerIndex", "(", "listener", ")", ";", "if", "(", "idx", "!=", "-", "1", ")", "{", "_listeners", "[", "idx", "]", "=", "null", ";", "}", "}" ]
Removes an event listener from this object. The listener will no longer be notified when events are dispatched on this object. @param listener the listener to be removed.
[ "Removes", "an", "event", "listener", "from", "this", "object", ".", "The", "listener", "will", "no", "longer", "be", "notified", "when", "events", "are", "dispatched", "on", "this", "object", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L227-L233
41,125
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.getSet
public final <T extends DSet.Entry> DSet<T> getSet (String setName) { @SuppressWarnings("unchecked") DSet<T> casted = (DSet<T>)getAccessor(setName).get(this); return casted; }
java
public final <T extends DSet.Entry> DSet<T> getSet (String setName) { @SuppressWarnings("unchecked") DSet<T> casted = (DSet<T>)getAccessor(setName).get(this); return casted; }
[ "public", "final", "<", "T", "extends", "DSet", ".", "Entry", ">", "DSet", "<", "T", ">", "getSet", "(", "String", "setName", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "DSet", "<", "T", ">", "casted", "=", "(", "DSet", "<", "T", ...
Get the DSet with the specified name.
[ "Get", "the", "DSet", "with", "the", "specified", "name", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L258-L262
41,126
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.addToSet
public <T extends DSet.Entry> void addToSet (String setName, T entry) { requestEntryAdd(setName, getSet(setName), entry); }
java
public <T extends DSet.Entry> void addToSet (String setName, T entry) { requestEntryAdd(setName, getSet(setName), entry); }
[ "public", "<", "T", "extends", "DSet", ".", "Entry", ">", "void", "addToSet", "(", "String", "setName", ",", "T", "entry", ")", "{", "requestEntryAdd", "(", "setName", ",", "getSet", "(", "setName", ")", ",", "entry", ")", ";", "}" ]
Request to have the specified item added to the specified DSet.
[ "Request", "to", "have", "the", "specified", "item", "added", "to", "the", "specified", "DSet", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L267-L270
41,127
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.updateSet
public void updateSet (String setName, DSet.Entry entry) { requestEntryUpdate(setName, getSet(setName), entry); }
java
public void updateSet (String setName, DSet.Entry entry) { requestEntryUpdate(setName, getSet(setName), entry); }
[ "public", "void", "updateSet", "(", "String", "setName", ",", "DSet", ".", "Entry", "entry", ")", "{", "requestEntryUpdate", "(", "setName", ",", "getSet", "(", "setName", ")", ",", "entry", ")", ";", "}" ]
Request to have the specified item updated in the specified DSet.
[ "Request", "to", "have", "the", "specified", "item", "updated", "in", "the", "specified", "DSet", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L275-L278
41,128
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.removeFromSet
public void removeFromSet (String setName, Comparable<?> key) { requestEntryRemove(setName, getSet(setName), key); }
java
public void removeFromSet (String setName, Comparable<?> key) { requestEntryRemove(setName, getSet(setName), key); }
[ "public", "void", "removeFromSet", "(", "String", "setName", ",", "Comparable", "<", "?", ">", "key", ")", "{", "requestEntryRemove", "(", "setName", ",", "getSet", "(", "setName", ")", ",", "key", ")", ";", "}" ]
Request to have the specified key removed from the specified DSet.
[ "Request", "to", "have", "the", "specified", "key", "removed", "from", "the", "specified", "DSet", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L283-L286
41,129
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.notifyListeners
public void notifyListeners (DEvent event) { if (_listeners == null) { return; } for (int ii = 0, ll = _listeners.length; ii < ll; ii++) { Object listener = _listeners[ii]; if (listener == null) { continue; } if (li...
java
public void notifyListeners (DEvent event) { if (_listeners == null) { return; } for (int ii = 0, ll = _listeners.length; ii < ll; ii++) { Object listener = _listeners[ii]; if (listener == null) { continue; } if (li...
[ "public", "void", "notifyListeners", "(", "DEvent", "event", ")", "{", "if", "(", "_listeners", "==", "null", ")", "{", "return", ";", "}", "for", "(", "int", "ii", "=", "0", ",", "ll", "=", "_listeners", ".", "length", ";", "ii", "<", "ll", ";", ...
Called by the distributed object manager after it has applied an event to this object. This dispatches an event notification to all of the listeners registered with this object. @param event the event that was just applied.
[ "Called", "by", "the", "distributed", "object", "manager", "after", "it", "has", "applied", "an", "event", "to", "this", "object", ".", "This", "dispatches", "an", "event", "notification", "to", "all", "of", "the", "listeners", "registered", "with", "this", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L408-L440
41,130
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.notifyProxies
public void notifyProxies (DEvent event) { if (_subs == null || event.isPrivate()) { return; } for (Object sub : _subs) { try { if (sub != null && sub instanceof ProxySubscriber) { ((ProxySubscriber)sub).eventReceived(event); ...
java
public void notifyProxies (DEvent event) { if (_subs == null || event.isPrivate()) { return; } for (Object sub : _subs) { try { if (sub != null && sub instanceof ProxySubscriber) { ((ProxySubscriber)sub).eventReceived(event); ...
[ "public", "void", "notifyProxies", "(", "DEvent", "event", ")", "{", "if", "(", "_subs", "==", "null", "||", "event", ".", "isPrivate", "(", ")", ")", "{", "return", ";", "}", "for", "(", "Object", "sub", ":", "_subs", ")", "{", "try", "{", "if", ...
Called by the distributed object manager after it has applied an event to this object. This dispatches an event notification to all of the proxy listeners registered with this object. @param event the event that was just applied.
[ "Called", "by", "the", "distributed", "object", "manager", "after", "it", "has", "applied", "an", "event", "to", "this", "object", ".", "This", "dispatches", "an", "event", "notification", "to", "all", "of", "the", "proxy", "listeners", "registered", "with", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L448-L463
41,131
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.changeAttribute
public void changeAttribute (String name, Object value) { Accessor acc = getAccessor(name); requestAttributeChange(name, value, acc.get(this)); acc.set(this, value); }
java
public void changeAttribute (String name, Object value) { Accessor acc = getAccessor(name); requestAttributeChange(name, value, acc.get(this)); acc.set(this, value); }
[ "public", "void", "changeAttribute", "(", "String", "name", ",", "Object", "value", ")", "{", "Accessor", "acc", "=", "getAccessor", "(", "name", ")", ";", "requestAttributeChange", "(", "name", ",", "value", ",", "acc", ".", "get", "(", "this", ")", ")"...
Requests that the specified attribute be changed to the specified value. Normally the generated setter methods should be used but in rare cases a caller may wish to update distributed fields in a generic manner.
[ "Requests", "that", "the", "specified", "attribute", "be", "changed", "to", "the", "specified", "value", ".", "Normally", "the", "generated", "setter", "methods", "should", "be", "used", "but", "in", "rare", "cases", "a", "caller", "may", "wish", "to", "upda...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L470-L475
41,132
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.postEvent
public void postEvent (DEvent event) { if (_tevent != null) { _tevent.postEvent(event); } else if (_omgr != null) { _omgr.postEvent(event); } else { log.info("Dropping event for non- or no longer managed object", "oid", getOid(), "cl...
java
public void postEvent (DEvent event) { if (_tevent != null) { _tevent.postEvent(event); } else if (_omgr != null) { _omgr.postEvent(event); } else { log.info("Dropping event for non- or no longer managed object", "oid", getOid(), "cl...
[ "public", "void", "postEvent", "(", "DEvent", "event", ")", "{", "if", "(", "_tevent", "!=", "null", ")", "{", "_tevent", ".", "postEvent", "(", "event", ")", ";", "}", "else", "if", "(", "_omgr", "!=", "null", ")", "{", "_omgr", ".", "postEvent", ...
Posts the specified event either to our dobject manager or to the compound event for which we are currently transacting.
[ "Posts", "the", "specified", "event", "either", "to", "our", "dobject", "manager", "or", "to", "the", "compound", "event", "for", "which", "we", "are", "currently", "transacting", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L519-L531
41,133
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.which
protected void which (StringBuilder buf) { buf.append(StringUtil.shortClassName(this)); buf.append(":").append(_oid); }
java
protected void which (StringBuilder buf) { buf.append(StringUtil.shortClassName(this)); buf.append(":").append(_oid); }
[ "protected", "void", "which", "(", "StringBuilder", "buf", ")", "{", "buf", ".", "append", "(", "StringUtil", ".", "shortClassName", "(", "this", ")", ")", ";", "buf", ".", "append", "(", "\":\"", ")", ".", "append", "(", "_oid", ")", ";", "}" ]
Used to briefly describe this distributed object.
[ "Used", "to", "briefly", "describe", "this", "distributed", "object", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L681-L685
41,134
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.commitTransaction
public void commitTransaction () { if (_tevent == null) { String errmsg = "Cannot commit: not involved in a transaction [dobj=" + this + "]"; throw new IllegalStateException(errmsg); } // if we are nested, we decrement our nesting count rather than committing the tra...
java
public void commitTransaction () { if (_tevent == null) { String errmsg = "Cannot commit: not involved in a transaction [dobj=" + this + "]"; throw new IllegalStateException(errmsg); } // if we are nested, we decrement our nesting count rather than committing the tra...
[ "public", "void", "commitTransaction", "(", ")", "{", "if", "(", "_tevent", "==", "null", ")", "{", "String", "errmsg", "=", "\"Cannot commit: not involved in a transaction [dobj=\"", "+", "this", "+", "\"]\"", ";", "throw", "new", "IllegalStateException", "(", "e...
Commits the transaction in which this distributed object is involved. @see CompoundEvent#commit
[ "Commits", "the", "transaction", "in", "which", "this", "distributed", "object", "is", "involved", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L741-L761
41,135
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.cancelTransaction
public void cancelTransaction () { if (_tevent == null) { String errmsg = "Cannot cancel: not involved in a transaction [dobj=" + this + "]"; throw new IllegalStateException(errmsg); } // if we're in a nested transaction, make a note that it is to be cancelled when a...
java
public void cancelTransaction () { if (_tevent == null) { String errmsg = "Cannot cancel: not involved in a transaction [dobj=" + this + "]"; throw new IllegalStateException(errmsg); } // if we're in a nested transaction, make a note that it is to be cancelled when a...
[ "public", "void", "cancelTransaction", "(", ")", "{", "if", "(", "_tevent", "==", "null", ")", "{", "String", "errmsg", "=", "\"Cannot cancel: not involved in a transaction [dobj=\"", "+", "this", "+", "\"]\"", ";", "throw", "new", "IllegalStateException", "(", "e...
Cancels the transaction in which this distributed object is involved. @see CompoundEvent#cancel
[ "Cancels", "the", "transaction", "in", "which", "this", "distributed", "object", "is", "involved", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L776-L792
41,136
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.requestOidAdd
protected void requestOidAdd (String name, OidList list, int oid) { // if we're on the authoritative server, we update the set immediately boolean applyImmediately = isAuthoritative(); if (applyImmediately) { list.add(oid); } postEvent(new ObjectAddedEvent(_oid, n...
java
protected void requestOidAdd (String name, OidList list, int oid) { // if we're on the authoritative server, we update the set immediately boolean applyImmediately = isAuthoritative(); if (applyImmediately) { list.add(oid); } postEvent(new ObjectAddedEvent(_oid, n...
[ "protected", "void", "requestOidAdd", "(", "String", "name", ",", "OidList", "list", ",", "int", "oid", ")", "{", "// if we're on the authoritative server, we update the set immediately", "boolean", "applyImmediately", "=", "isAuthoritative", "(", ")", ";", "if", "(", ...
Calls by derived instances when an oid adder method was called.
[ "Calls", "by", "derived", "instances", "when", "an", "oid", "adder", "method", "was", "called", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L851-L859
41,137
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.requestOidRemove
protected void requestOidRemove (String name, OidList list, int oid) { // if we're on the authoritative server, we update the set immediately boolean applyImmediately = isAuthoritative(); if (applyImmediately) { list.remove(oid); } // dispatch an object removed ev...
java
protected void requestOidRemove (String name, OidList list, int oid) { // if we're on the authoritative server, we update the set immediately boolean applyImmediately = isAuthoritative(); if (applyImmediately) { list.remove(oid); } // dispatch an object removed ev...
[ "protected", "void", "requestOidRemove", "(", "String", "name", ",", "OidList", "list", ",", "int", "oid", ")", "{", "// if we're on the authoritative server, we update the set immediately", "boolean", "applyImmediately", "=", "isAuthoritative", "(", ")", ";", "if", "("...
Calls by derived instances when an oid remover method was called.
[ "Calls", "by", "derived", "instances", "when", "an", "oid", "remover", "method", "was", "called", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L864-L873
41,138
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.requestEntryAdd
protected <T extends DSet.Entry> void requestEntryAdd (String name, DSet<T> set, T entry) { // if we're on the authoritative server, we update the set immediately boolean applyImmediately = isAuthoritative(); if (applyImmediately) { set.add(entry); } // dispatch a...
java
protected <T extends DSet.Entry> void requestEntryAdd (String name, DSet<T> set, T entry) { // if we're on the authoritative server, we update the set immediately boolean applyImmediately = isAuthoritative(); if (applyImmediately) { set.add(entry); } // dispatch a...
[ "protected", "<", "T", "extends", "DSet", ".", "Entry", ">", "void", "requestEntryAdd", "(", "String", "name", ",", "DSet", "<", "T", ">", "set", ",", "T", "entry", ")", "{", "// if we're on the authoritative server, we update the set immediately", "boolean", "app...
Calls by derived instances when a set adder method was called.
[ "Calls", "by", "derived", "instances", "when", "a", "set", "adder", "method", "was", "called", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L890-L899
41,139
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.requestEntryRemove
protected <T extends DSet.Entry> void requestEntryRemove ( String name, DSet<T> set, Comparable<?> key) { // if we're on the authoritative server, we update the set immediately T oldEntry = null; if (isAuthoritative()) { oldEntry = set.removeKey(key); if (oldE...
java
protected <T extends DSet.Entry> void requestEntryRemove ( String name, DSet<T> set, Comparable<?> key) { // if we're on the authoritative server, we update the set immediately T oldEntry = null; if (isAuthoritative()) { oldEntry = set.removeKey(key); if (oldE...
[ "protected", "<", "T", "extends", "DSet", ".", "Entry", ">", "void", "requestEntryRemove", "(", "String", "name", ",", "DSet", "<", "T", ">", "set", ",", "Comparable", "<", "?", ">", "key", ")", "{", "// if we're on the authoritative server, we update the set im...
Calls by derived instances when a set remover method was called.
[ "Calls", "by", "derived", "instances", "when", "a", "set", "remover", "method", "was", "called", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L904-L918
41,140
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.createAccessors
protected Accessor[] createAccessors () { Field[] fields = getClass().getFields(); // assume we have one static field for every non-static field List<Accessor> accs = Lists.newArrayListWithExpectedSize(fields.length/2); for (Field field : fields) { if (!Modifier.isStatic(...
java
protected Accessor[] createAccessors () { Field[] fields = getClass().getFields(); // assume we have one static field for every non-static field List<Accessor> accs = Lists.newArrayListWithExpectedSize(fields.length/2); for (Field field : fields) { if (!Modifier.isStatic(...
[ "protected", "Accessor", "[", "]", "createAccessors", "(", ")", "{", "Field", "[", "]", "fields", "=", "getClass", "(", ")", ".", "getFields", "(", ")", ";", "// assume we have one static field for every non-static field", "List", "<", "Accessor", ">", "accs", "...
Creates the accessors that will be used to read and write this object's attributes. The default implementation assumes the object's attributes are all public fields and uses reflection to get and set their values.
[ "Creates", "the", "accessors", "that", "will", "be", "used", "to", "read", "and", "write", "this", "object", "s", "attributes", ".", "The", "default", "implementation", "assumes", "the", "object", "s", "attributes", "are", "all", "public", "fields", "and", "...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L980-L991
41,141
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DObject.java
DObject.getListenerIndex
protected int getListenerIndex (ChangeListener listener) { if (_listeners == null) { return -1; } for (int ii = 0, ll = _listeners.length; ii < ll; ii++) { Object olistener = _listeners[ii]; if (olistener == listener || (olistener instanceof WeakReference<...
java
protected int getListenerIndex (ChangeListener listener) { if (_listeners == null) { return -1; } for (int ii = 0, ll = _listeners.length; ii < ll; ii++) { Object olistener = _listeners[ii]; if (olistener == listener || (olistener instanceof WeakReference<...
[ "protected", "int", "getListenerIndex", "(", "ChangeListener", "listener", ")", "{", "if", "(", "_listeners", "==", "null", ")", "{", "return", "-", "1", ";", "}", "for", "(", "int", "ii", "=", "0", ",", "ll", "=", "_listeners", ".", "length", ";", "...
Returns the index of the identified listener, or -1 if not found.
[ "Returns", "the", "index", "of", "the", "identified", "listener", "or", "-", "1", "if", "not", "found", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L996-L1009
41,142
threerings/narya
core/src/main/java/com/threerings/admin/server/AdminManager.java
AdminManager.getConfigInfo
public void getConfigInfo (ClientObject caller, AdminService.ConfigInfoListener listener) throws InvocationException { // we don't have to validate the request because the user can't do anything with the keys // or oids unless they're an admin (we put the burden of doing that checking on the...
java
public void getConfigInfo (ClientObject caller, AdminService.ConfigInfoListener listener) throws InvocationException { // we don't have to validate the request because the user can't do anything with the keys // or oids unless they're an admin (we put the burden of doing that checking on the...
[ "public", "void", "getConfigInfo", "(", "ClientObject", "caller", ",", "AdminService", ".", "ConfigInfoListener", "listener", ")", "throws", "InvocationException", "{", "// we don't have to validate the request because the user can't do anything with the keys", "// or oids unless the...
from interface AdminProvider
[ "from", "interface", "AdminProvider" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/server/AdminManager.java#L48-L61
41,143
threerings/narya
core/src/main/java/com/threerings/presents/net/ServiceCreds.java
ServiceCreds.createAuthToken
protected static String createAuthToken (String clientId, String sharedSecret) { return StringUtil.md5hex(clientId + sharedSecret); }
java
protected static String createAuthToken (String clientId, String sharedSecret) { return StringUtil.md5hex(clientId + sharedSecret); }
[ "protected", "static", "String", "createAuthToken", "(", "String", "clientId", ",", "String", "sharedSecret", ")", "{", "return", "StringUtil", ".", "md5hex", "(", "clientId", "+", "sharedSecret", ")", ";", "}" ]
Creates a unique password for the specified node using the supplied shared secret.
[ "Creates", "a", "unique", "password", "for", "the", "specified", "node", "using", "the", "supplied", "shared", "secret", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/ServiceCreds.java#L68-L71
41,144
threerings/narya
core/src/main/java/com/threerings/nio/conman/ServerSocketChannelAcceptor.java
ServerSocketChannelAcceptor.bind
public boolean bind () { // open our TCP listening ports int successes = 0; for (int port : _ports) { try { acceptConnections(port); successes++; } catch (IOException ioe) { log.warning("Failure listening to socket", "ho...
java
public boolean bind () { // open our TCP listening ports int successes = 0; for (int port : _ports) { try { acceptConnections(port); successes++; } catch (IOException ioe) { log.warning("Failure listening to socket", "ho...
[ "public", "boolean", "bind", "(", ")", "{", "// open our TCP listening ports", "int", "successes", "=", "0", ";", "for", "(", "int", "port", ":", "_ports", ")", "{", "try", "{", "acceptConnections", "(", "port", ")", ";", "successes", "++", ";", "}", "ca...
Bind to the socket ports and return true if any of the binds succeeded.
[ "Bind", "to", "the", "socket", "ports", "and", "return", "true", "if", "any", "of", "the", "binds", "succeeded", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/nio/conman/ServerSocketChannelAcceptor.java#L67-L81
41,145
threerings/narya
core/src/main/java/com/threerings/nio/conman/ServerSocketChannelAcceptor.java
ServerSocketChannelAcceptor.shutdown
public void shutdown () { for (ServerSocketChannel ssocket : _ssockets) { try { ssocket.socket().close(); } catch (IOException ioe) { log.warning("Failed to close listening socket: " + ssocket, ioe); } } }
java
public void shutdown () { for (ServerSocketChannel ssocket : _ssockets) { try { ssocket.socket().close(); } catch (IOException ioe) { log.warning("Failed to close listening socket: " + ssocket, ioe); } } }
[ "public", "void", "shutdown", "(", ")", "{", "for", "(", "ServerSocketChannel", "ssocket", ":", "_ssockets", ")", "{", "try", "{", "ssocket", ".", "socket", "(", ")", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "lo...
Unbind our listening sockets.
[ "Unbind", "our", "listening", "sockets", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/nio/conman/ServerSocketChannelAcceptor.java#L86-L95
41,146
threerings/narya
tools/src/main/java/com/threerings/presents/tools/InvocationTask.java
InvocationTask.createAndGatherImports
public ServiceMethod createAndGatherImports (Method method, ImportSet imports) { ServiceMethod sm = new ServiceMethod(method); sm.gatherImports(imports); return sm; }
java
public ServiceMethod createAndGatherImports (Method method, ImportSet imports) { ServiceMethod sm = new ServiceMethod(method); sm.gatherImports(imports); return sm; }
[ "public", "ServiceMethod", "createAndGatherImports", "(", "Method", "method", ",", "ImportSet", "imports", ")", "{", "ServiceMethod", "sm", "=", "new", "ServiceMethod", "(", "method", ")", ";", "sm", ".", "gatherImports", "(", "imports", ")", ";", "return", "s...
Creates a new service method and adds its basic imports to a set. @param method the method to create @param imports will be filled with the types required by the method
[ "Creates", "a", "new", "service", "method", "and", "adds", "its", "basic", "imports", "to", "a", "set", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/InvocationTask.java#L95-L100
41,147
threerings/narya
core/src/main/java/com/threerings/presents/data/TimeBaseObject.java
TimeBaseObject.getDelta
protected long getDelta (long timeStamp, long maxValue) { boolean even = (evenBase > oddBase); long base = even ? evenBase : oddBase; long delta = timeStamp - base; // make sure this timestamp is not sufficiently old that we can't // generate a delta time with it if ...
java
protected long getDelta (long timeStamp, long maxValue) { boolean even = (evenBase > oddBase); long base = even ? evenBase : oddBase; long delta = timeStamp - base; // make sure this timestamp is not sufficiently old that we can't // generate a delta time with it if ...
[ "protected", "long", "getDelta", "(", "long", "timeStamp", ",", "long", "maxValue", ")", "{", "boolean", "even", "=", "(", "evenBase", ">", "oddBase", ")", ";", "long", "base", "=", "even", "?", "evenBase", ":", "oddBase", ";", "long", "delta", "=", "t...
Obtains a delta with the specified maximum value, swapping from even to odd, if necessary.
[ "Obtains", "a", "delta", "with", "the", "specified", "maximum", "value", "swapping", "from", "even", "to", "odd", "if", "necessary", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/data/TimeBaseObject.java#L103-L132
41,148
threerings/narya
core/src/main/java/com/threerings/presents/data/ClientObject.java
ClientObject.checkAccess
public String checkAccess (Permission perm, Object context) { if (_permPolicy == null) { _permPolicy = createPermissionPolicy(); } return _permPolicy.checkAccess(perm, context); }
java
public String checkAccess (Permission perm, Object context) { if (_permPolicy == null) { _permPolicy = createPermissionPolicy(); } return _permPolicy.checkAccess(perm, context); }
[ "public", "String", "checkAccess", "(", "Permission", "perm", ",", "Object", "context", ")", "{", "if", "(", "_permPolicy", "==", "null", ")", "{", "_permPolicy", "=", "createPermissionPolicy", "(", ")", ";", "}", "return", "_permPolicy", ".", "checkAccess", ...
Checks whether or not this client has the specified permission. @return null if the user has access, a fully-qualified translatable message string indicating the reason for denial of access. @see ClientObject.PermissionPolicy
[ "Checks", "whether", "or", "not", "this", "client", "has", "the", "specified", "permission", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/data/ClientObject.java#L73-L79
41,149
xbib/marc
src/main/java/org/xbib/marc/transformer/value/MarcValueTransformers.java
MarcValueTransformers.setMarcValueTransformer
public MarcValueTransformers setMarcValueTransformer(String fieldKey, MarcValueTransformer transformer) { // split into tag + indicator and subfield IDs int pos = fieldKey.lastIndexOf('$'); String tagind = pos > 0 ? fieldKey.substring(0, pos) : fieldKey; String subs = pos > 0 ? fieldKey...
java
public MarcValueTransformers setMarcValueTransformer(String fieldKey, MarcValueTransformer transformer) { // split into tag + indicator and subfield IDs int pos = fieldKey.lastIndexOf('$'); String tagind = pos > 0 ? fieldKey.substring(0, pos) : fieldKey; String subs = pos > 0 ? fieldKey...
[ "public", "MarcValueTransformers", "setMarcValueTransformer", "(", "String", "fieldKey", ",", "MarcValueTransformer", "transformer", ")", "{", "// split into tag + indicator and subfield IDs", "int", "pos", "=", "fieldKey", ".", "lastIndexOf", "(", "'", "'", ")", ";", ...
Set MARC value transformer for transforming field values. @param fieldKey the MARC field key for the field to be transformed @param transformer the string transformer @return this handler
[ "Set", "MARC", "value", "transformer", "for", "transforming", "field", "values", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/transformer/value/MarcValueTransformers.java#L45-L54
41,150
xbib/marc
src/main/java/org/xbib/marc/transformer/value/MarcValueTransformers.java
MarcValueTransformers.transformValue
public MarcField transformValue(MarcField field) { String key = field.toTagIndicatorKey(); if (marcValueTransformerMap.isEmpty()) { return field; } final MarcValueTransformer transformer = marcValueTransformerMap.containsKey(key) ? marcValueTransformerMap.get(...
java
public MarcField transformValue(MarcField field) { String key = field.toTagIndicatorKey(); if (marcValueTransformerMap.isEmpty()) { return field; } final MarcValueTransformer transformer = marcValueTransformerMap.containsKey(key) ? marcValueTransformerMap.get(...
[ "public", "MarcField", "transformValue", "(", "MarcField", "field", ")", "{", "String", "key", "=", "field", ".", "toTagIndicatorKey", "(", ")", ";", "if", "(", "marcValueTransformerMap", ".", "isEmpty", "(", ")", ")", "{", "return", "field", ";", "}", "fi...
Transform value. @param field the MARC field where values are transformed @return a new MARC field with transformed values
[ "Transform", "value", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/transformer/value/MarcValueTransformers.java#L61-L82
41,151
threerings/narya
core/src/main/java/com/threerings/io/ByteBufferOutputStream.java
ByteBufferOutputStream.expand
protected final void expand (int needed) { int ocapacity = _buffer.capacity(); int ncapacity = _buffer.position() + needed; if (ncapacity > ocapacity) { // increase the buffer size in large increments ncapacity = Math.max(ocapacity << 1, ncapacity); ByteBu...
java
protected final void expand (int needed) { int ocapacity = _buffer.capacity(); int ncapacity = _buffer.position() + needed; if (ncapacity > ocapacity) { // increase the buffer size in large increments ncapacity = Math.max(ocapacity << 1, ncapacity); ByteBu...
[ "protected", "final", "void", "expand", "(", "int", "needed", ")", "{", "int", "ocapacity", "=", "_buffer", ".", "capacity", "(", ")", ";", "int", "ncapacity", "=", "_buffer", ".", "position", "(", ")", "+", "needed", ";", "if", "(", "ncapacity", ">", ...
Expands our buffer to accomodate the specified capacity.
[ "Expands", "our", "buffer", "to", "accomodate", "the", "specified", "capacity", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ByteBufferOutputStream.java#L102-L113
41,152
threerings/narya
core/src/main/java/com/threerings/crowd/chat/data/UserSystemMessage.java
UserSystemMessage.create
public static UserSystemMessage create (Name sender, String message, String bundle) { return new UserSystemMessage(sender, message, bundle, INFO); }
java
public static UserSystemMessage create (Name sender, String message, String bundle) { return new UserSystemMessage(sender, message, bundle, INFO); }
[ "public", "static", "UserSystemMessage", "create", "(", "Name", "sender", ",", "String", "message", ",", "String", "bundle", ")", "{", "return", "new", "UserSystemMessage", "(", "sender", ",", "message", ",", "bundle", ",", "INFO", ")", ";", "}" ]
Construct a INFO-level UserSystemMessage.
[ "Construct", "a", "INFO", "-", "level", "UserSystemMessage", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/data/UserSystemMessage.java#L38-L41
41,153
davidmoten/grumpy
grumpy-projection/src/main/java/com/github/davidmoten/grumpy/util/NearBSpline.java
NearBSpline.setLine
public void setLine(int... points) { double[] pd = new double[points.length]; for (int i = 0; i < points.length; i++) { pd[i] = points[i]; } setLine(pd); }
java
public void setLine(int... points) { double[] pd = new double[points.length]; for (int i = 0; i < points.length; i++) { pd[i] = points[i]; } setLine(pd); }
[ "public", "void", "setLine", "(", "int", "...", "points", ")", "{", "double", "[", "]", "pd", "=", "new", "double", "[", "points", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "points", ".", "length", ";", "i", "++"...
Sets the curve using control points given in integer precision @param points the control points for the curve
[ "Sets", "the", "curve", "using", "control", "points", "given", "in", "integer", "precision" ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-projection/src/main/java/com/github/davidmoten/grumpy/util/NearBSpline.java#L58-L64
41,154
davidmoten/grumpy
grumpy-projection/src/main/java/com/github/davidmoten/grumpy/util/NearBSpline.java
NearBSpline.setLine
public void setLine(Point2D[] points) { double[] pd = new double[points.length * 2]; for (int i = 0; i < points.length; i++) { Point2D p = points[i]; pd[i * 2] = p.getX(); pd[i * 2 + 1] = p.getY(); } setLine(pd); }
java
public void setLine(Point2D[] points) { double[] pd = new double[points.length * 2]; for (int i = 0; i < points.length; i++) { Point2D p = points[i]; pd[i * 2] = p.getX(); pd[i * 2 + 1] = p.getY(); } setLine(pd); }
[ "public", "void", "setLine", "(", "Point2D", "[", "]", "points", ")", "{", "double", "[", "]", "pd", "=", "new", "double", "[", "points", ".", "length", "*", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "points", ".", "length...
Sets the curve using control points given as Point2D objects @param points the control points for the curve
[ "Sets", "the", "curve", "using", "control", "points", "given", "as", "Point2D", "objects" ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-projection/src/main/java/com/github/davidmoten/grumpy/util/NearBSpline.java#L128-L136
41,155
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.addClientObserver
public void addClientObserver (ClientObserver observer) { _clobservers.add(observer); if (observer instanceof DetailedClientObserver) { _dclobservers.add((DetailedClientObserver)observer); } }
java
public void addClientObserver (ClientObserver observer) { _clobservers.add(observer); if (observer instanceof DetailedClientObserver) { _dclobservers.add((DetailedClientObserver)observer); } }
[ "public", "void", "addClientObserver", "(", "ClientObserver", "observer", ")", "{", "_clobservers", ".", "add", "(", "observer", ")", ";", "if", "(", "observer", "instanceof", "DetailedClientObserver", ")", "{", "_dclobservers", ".", "add", "(", "(", "DetailedCl...
Registers an observer that will be notified when clients start and end their sessions.
[ "Registers", "an", "observer", "that", "will", "be", "notified", "when", "clients", "start", "and", "end", "their", "sessions", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L219-L225
41,156
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.applyToClient
public void applyToClient (Name username, final ClientOp clop) { resolveClientObject(username, new ClientResolutionListener() { public void clientResolved (Name username, ClientObject clobj) { try { clop.apply(clobj); } catch (Exception e) { ...
java
public void applyToClient (Name username, final ClientOp clop) { resolveClientObject(username, new ClientResolutionListener() { public void clientResolved (Name username, ClientObject clobj) { try { clop.apply(clobj); } catch (Exception e) { ...
[ "public", "void", "applyToClient", "(", "Name", "username", ",", "final", "ClientOp", "clop", ")", "{", "resolveClientObject", "(", "username", ",", "new", "ClientResolutionListener", "(", ")", "{", "public", "void", "clientResolved", "(", "Name", "username", ",...
Resolves the specified client, applies the supplied client operation to them and releases the client.
[ "Resolves", "the", "specified", "client", "applies", "the", "supplied", "client", "operation", "to", "them", "and", "releases", "the", "client", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L262-L281
41,157
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.shutdown
public void shutdown () { log.info("Client manager shutting down", "ccount", _usermap.size()); // inform all of our clients that they are being shut down synchronized (_usermap) { for (PresentsSession pc : _usermap.values()) { try { pc.shutdow...
java
public void shutdown () { log.info("Client manager shutting down", "ccount", _usermap.size()); // inform all of our clients that they are being shut down synchronized (_usermap) { for (PresentsSession pc : _usermap.values()) { try { pc.shutdow...
[ "public", "void", "shutdown", "(", ")", "{", "log", ".", "info", "(", "\"Client manager shutting down\"", ",", "\"ccount\"", ",", "_usermap", ".", "size", "(", ")", ")", ";", "// inform all of our clients that they are being shut down", "synchronized", "(", "_usermap"...
from interface Lifecycle.Component
[ "from", "interface", "Lifecycle", ".", "Component" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L386-L401
41,158
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.clientResolved
public synchronized void clientResolved (Name username, ClientObject clobj) { // because we added ourselves as a client resolution listener, the client object reference // count was increased, but we're not a real resolver (who would have to call // releaseClientObject() to release their ref...
java
public synchronized void clientResolved (Name username, ClientObject clobj) { // because we added ourselves as a client resolution listener, the client object reference // count was increased, but we're not a real resolver (who would have to call // releaseClientObject() to release their ref...
[ "public", "synchronized", "void", "clientResolved", "(", "Name", "username", ",", "ClientObject", "clobj", ")", "{", "// because we added ourselves as a client resolution listener, the client object reference", "// count was increased, but we're not a real resolver (who would have to call"...
documentation inherited from interface ClientResolutionListener
[ "documentation", "inherited", "from", "interface", "ClientResolutionListener" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L421-L434
41,159
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.connectionEstablished
public synchronized void connectionEstablished ( PresentsConnection conn, Name authname, AuthRequest req, AuthResponse rsp) { String type = authname.getClass().getSimpleName(); // see if a session is already registered with this name PresentsSession session = getClient(authname); ...
java
public synchronized void connectionEstablished ( PresentsConnection conn, Name authname, AuthRequest req, AuthResponse rsp) { String type = authname.getClass().getSimpleName(); // see if a session is already registered with this name PresentsSession session = getClient(authname); ...
[ "public", "synchronized", "void", "connectionEstablished", "(", "PresentsConnection", "conn", ",", "Name", "authname", ",", "AuthRequest", "req", ",", "AuthResponse", "rsp", ")", "{", "String", "type", "=", "authname", ".", "getClass", "(", ")", ".", "getSimpleN...
Called by the connection manager to let us know when a new connection has been established.
[ "Called", "by", "the", "connection", "manager", "to", "let", "us", "know", "when", "a", "new", "connection", "has", "been", "established", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L446-L481
41,160
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.connectionFailed
public synchronized void connectionFailed (Connection conn, IOException fault) { // remove the session from the connection map PresentsSession session = _conmap.remove(conn); if (session != null) { log.info("Unmapped failed session", "session", session, "conn", conn, "fault", fau...
java
public synchronized void connectionFailed (Connection conn, IOException fault) { // remove the session from the connection map PresentsSession session = _conmap.remove(conn); if (session != null) { log.info("Unmapped failed session", "session", session, "conn", conn, "fault", fau...
[ "public", "synchronized", "void", "connectionFailed", "(", "Connection", "conn", ",", "IOException", "fault", ")", "{", "// remove the session from the connection map", "PresentsSession", "session", "=", "_conmap", ".", "remove", "(", "conn", ")", ";", "if", "(", "s...
Called by the connection manager to let us know when a connection has failed.
[ "Called", "by", "the", "connection", "manager", "to", "let", "us", "know", "when", "a", "connection", "has", "failed", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L486-L500
41,161
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.connectionClosed
public synchronized void connectionClosed (Connection conn) { // remove the session from the connection map PresentsSession session = _conmap.remove(conn); if (session != null) { log.debug("Unmapped session", "session", session, "conn", conn); // let the session know ...
java
public synchronized void connectionClosed (Connection conn) { // remove the session from the connection map PresentsSession session = _conmap.remove(conn); if (session != null) { log.debug("Unmapped session", "session", session, "conn", conn); // let the session know ...
[ "public", "synchronized", "void", "connectionClosed", "(", "Connection", "conn", ")", "{", "// remove the session from the connection map", "PresentsSession", "session", "=", "_conmap", ".", "remove", "(", "conn", ")", ";", "if", "(", "session", "!=", "null", ")", ...
Called by the connection manager to let us know when a connection has been closed.
[ "Called", "by", "the", "connection", "manager", "to", "let", "us", "know", "when", "a", "connection", "has", "been", "closed", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L505-L518
41,162
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.appendReport
public void appendReport (StringBuilder report, long now, long sinceLast, boolean reset) { report.append("* presents.ClientManager:\n"); report.append("- Sessions: "); synchronized (_usermap) { report.append(_usermap.size()).append(" total, "); } report.append(_co...
java
public void appendReport (StringBuilder report, long now, long sinceLast, boolean reset) { report.append("* presents.ClientManager:\n"); report.append("- Sessions: "); synchronized (_usermap) { report.append(_usermap.size()).append(" total, "); } report.append(_co...
[ "public", "void", "appendReport", "(", "StringBuilder", "report", ",", "long", "now", ",", "long", "sinceLast", ",", "boolean", "reset", ")", "{", "report", ".", "append", "(", "\"* presents.ClientManager:\\n\"", ")", ";", "report", ".", "append", "(", "\"- Se...
documentation inherited from interface ReportManager.Reporter
[ "documentation", "inherited", "from", "interface", "ReportManager", ".", "Reporter" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L521-L531
41,163
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.clientSessionWillEnd
@EventThread protected void clientSessionWillEnd (final PresentsSession session) { // notify the observers that the session is ended _dclobservers.apply(new ObserverList.ObserverOp<DetailedClientObserver>() { public boolean apply (DetailedClientObserver observer) { ob...
java
@EventThread protected void clientSessionWillEnd (final PresentsSession session) { // notify the observers that the session is ended _dclobservers.apply(new ObserverList.ObserverOp<DetailedClientObserver>() { public boolean apply (DetailedClientObserver observer) { ob...
[ "@", "EventThread", "protected", "void", "clientSessionWillEnd", "(", "final", "PresentsSession", "session", ")", "{", "// notify the observers that the session is ended", "_dclobservers", ".", "apply", "(", "new", "ObserverList", ".", "ObserverOp", "<", "DetailedClientObse...
Called by PresentsSession when it is about to end its session.
[ "Called", "by", "PresentsSession", "when", "it", "is", "about", "to", "end", "its", "session", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L551-L561
41,164
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.clientSessionDidEnd
@EventThread protected void clientSessionDidEnd (final PresentsSession session) { // notify the observers that the session is ended _clobservers.apply(new ObserverList.ObserverOp<ClientObserver>() { public boolean apply (ClientObserver observer) { observer.clientSessi...
java
@EventThread protected void clientSessionDidEnd (final PresentsSession session) { // notify the observers that the session is ended _clobservers.apply(new ObserverList.ObserverOp<ClientObserver>() { public boolean apply (ClientObserver observer) { observer.clientSessi...
[ "@", "EventThread", "protected", "void", "clientSessionDidEnd", "(", "final", "PresentsSession", "session", ")", "{", "// notify the observers that the session is ended", "_clobservers", ".", "apply", "(", "new", "ObserverList", ".", "ObserverOp", "<", "ClientObserver", "...
Called by PresentsSession when it has ended its session.
[ "Called", "by", "PresentsSession", "when", "it", "has", "ended", "its", "session", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L566-L576
41,165
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.clearSession
protected void clearSession (PresentsSession session) { // remove the session from the username map PresentsSession rc; synchronized (_usermap) { rc = _usermap.remove(session.getAuthName()); } // sanity check just because we can if (rc == null) { ...
java
protected void clearSession (PresentsSession session) { // remove the session from the username map PresentsSession rc; synchronized (_usermap) { rc = _usermap.remove(session.getAuthName()); } // sanity check just because we can if (rc == null) { ...
[ "protected", "void", "clearSession", "(", "PresentsSession", "session", ")", "{", "// remove the session from the username map", "PresentsSession", "rc", ";", "synchronized", "(", "_usermap", ")", "{", "rc", "=", "_usermap", ".", "remove", "(", "session", ".", "getA...
Called by PresentsSession to let us know that we can clear it entirely out of the system.
[ "Called", "by", "PresentsSession", "to", "let", "us", "know", "that", "we", "can", "clear", "it", "entirely", "out", "of", "the", "system", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L581-L597
41,166
threerings/narya
core/src/main/java/com/threerings/presents/server/ClientManager.java
ClientManager.flushSessions
protected void flushSessions () { List<PresentsSession> victims = Lists.newArrayList(); long now = System.currentTimeMillis(); // first build a list of our victims synchronized (_usermap) { for (PresentsSession session : _usermap.values()) { if (session.c...
java
protected void flushSessions () { List<PresentsSession> victims = Lists.newArrayList(); long now = System.currentTimeMillis(); // first build a list of our victims synchronized (_usermap) { for (PresentsSession session : _usermap.values()) { if (session.c...
[ "protected", "void", "flushSessions", "(", ")", "{", "List", "<", "PresentsSession", ">", "victims", "=", "Lists", ".", "newArrayList", "(", ")", ";", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "// first build a list of our victims", ...
Called once per minute to check for sessions that have been disconnected too long and forcibly end their sessions.
[ "Called", "once", "per", "minute", "to", "check", "for", "sessions", "that", "have", "been", "disconnected", "too", "long", "and", "forcibly", "end", "their", "sessions", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L603-L627
41,167
dkpro/dkpro-argumentation
dkpro-argumentation-preprocessing/src/main/java/org/dkpro/argumentation/preprocessing/annotation/ArgumentTokenBIOAnnotator.java
ArgumentTokenBIOAnnotator.getLabel
protected String getLabel(ArgumentComponent argumentComponent, Token token) { StringBuilder sb = new StringBuilder(argumentComponent.getClass().getSimpleName()); if ("BIO".equals(this.codingGranularity)) { // Does the component begin here? if (argumentComponent.getBegin() ==...
java
protected String getLabel(ArgumentComponent argumentComponent, Token token) { StringBuilder sb = new StringBuilder(argumentComponent.getClass().getSimpleName()); if ("BIO".equals(this.codingGranularity)) { // Does the component begin here? if (argumentComponent.getBegin() ==...
[ "protected", "String", "getLabel", "(", "ArgumentComponent", "argumentComponent", ",", "Token", "token", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "argumentComponent", ".", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ")", ";", ...
Returns a label for the annotated token @param argumentComponent covering argument component @param token token @return BIO label
[ "Returns", "a", "label", "for", "the", "annotated", "token" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-preprocessing/src/main/java/org/dkpro/argumentation/preprocessing/annotation/ArgumentTokenBIOAnnotator.java#L69-L87
41,168
threerings/narya
core/src/main/java/com/threerings/presents/client/ClientCommunicator.java
ClientCommunicator.clearPPI
protected synchronized boolean clearPPI (boolean cancel) { if (_prefPortInterval != null) { if (cancel) { _prefPortInterval.cancel(); _prefPortInterval.failed(); } _prefPortInterval = null; return true; } return ...
java
protected synchronized boolean clearPPI (boolean cancel) { if (_prefPortInterval != null) { if (cancel) { _prefPortInterval.cancel(); _prefPortInterval.failed(); } _prefPortInterval = null; return true; } return ...
[ "protected", "synchronized", "boolean", "clearPPI", "(", "boolean", "cancel", ")", "{", "if", "(", "_prefPortInterval", "!=", "null", ")", "{", "if", "(", "cancel", ")", "{", "_prefPortInterval", ".", "cancel", "(", ")", ";", "_prefPortInterval", ".", "faile...
Cancels our preferred port saving interval. This method is called from the communication reader thread and the interval thread and must thus be synchronized.
[ "Cancels", "our", "preferred", "port", "saving", "interval", ".", "This", "method", "is", "called", "from", "the", "communication", "reader", "thread", "and", "the", "interval", "thread", "and", "must", "thus", "be", "synchronized", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/ClientCommunicator.java#L125-L136
41,169
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/EHCachePeerCoordinator.java
EHCachePeerCoordinator.createCachePeerProvider
@Override public CacheManagerPeerProvider createCachePeerProvider ( CacheManager cacheManager, Properties properties) { if (_instance == null) { _instance = new Provider(cacheManager); } return _instance; }
java
@Override public CacheManagerPeerProvider createCachePeerProvider ( CacheManager cacheManager, Properties properties) { if (_instance == null) { _instance = new Provider(cacheManager); } return _instance; }
[ "@", "Override", "public", "CacheManagerPeerProvider", "createCachePeerProvider", "(", "CacheManager", "cacheManager", ",", "Properties", "properties", ")", "{", "if", "(", "_instance", "==", "null", ")", "{", "_instance", "=", "new", "Provider", "(", "cacheManager"...
Return our provider, creating it if needed.
[ "Return", "our", "provider", "creating", "it", "if", "needed", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/EHCachePeerCoordinator.java#L69-L77
41,170
xbib/marc
src/main/java/org/xbib/marc/io/BaseChunkStream.java
BaseChunkStream.chunks
@Override public Stream<Chunk<byte[], BytesReference>> chunks() { Iterator<Chunk<byte[], BytesReference>> iterator = new Iterator<Chunk<byte[], BytesReference>>() { Chunk<byte[], BytesReference> nextData = null; @Override public boolean hasNext() { if (ne...
java
@Override public Stream<Chunk<byte[], BytesReference>> chunks() { Iterator<Chunk<byte[], BytesReference>> iterator = new Iterator<Chunk<byte[], BytesReference>>() { Chunk<byte[], BytesReference> nextData = null; @Override public boolean hasNext() { if (ne...
[ "@", "Override", "public", "Stream", "<", "Chunk", "<", "byte", "[", "]", ",", "BytesReference", ">", ">", "chunks", "(", ")", "{", "Iterator", "<", "Chunk", "<", "byte", "[", "]", ",", "BytesReference", ">", ">", "iterator", "=", "new", "Iterator", ...
This methods creates a Java 8 stream of chunks. @return a stream of chunks
[ "This", "methods", "creates", "a", "Java", "8", "stream", "of", "chunks", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/io/BaseChunkStream.java#L74-L106
41,171
threerings/narya
core/src/main/java/com/threerings/presents/net/AESAuthRequest.java
AESAuthRequest.decrypt
public void decrypt (byte[] key) throws IOException, ClassNotFoundException { if (_clearCreds != null) { return; } _key = key; try { _contents = SecureUtil.getAESCipher(Cipher.DECRYPT_MODE, _key).doFinal(_contents); } catch (GeneralSecurityExcep...
java
public void decrypt (byte[] key) throws IOException, ClassNotFoundException { if (_clearCreds != null) { return; } _key = key; try { _contents = SecureUtil.getAESCipher(Cipher.DECRYPT_MODE, _key).doFinal(_contents); } catch (GeneralSecurityExcep...
[ "public", "void", "decrypt", "(", "byte", "[", "]", "key", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "if", "(", "_clearCreds", "!=", "null", ")", "{", "return", ";", "}", "_key", "=", "key", ";", "try", "{", "_contents", "=", "S...
Decrypts the request after transmission.
[ "Decrypts", "the", "request", "after", "transmission", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/AESAuthRequest.java#L106-L124
41,172
threerings/narya
core/src/main/java/com/threerings/presents/net/AESAuthRequest.java
AESAuthRequest.writeObject
public void writeObject (ObjectOutputStream out) throws IOException { out.defaultWriteObject(); ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); ObjectOutputStream oOut = new ObjectOutputStream(byteOut); oOut.writeObject(_clearCreds); try { byt...
java
public void writeObject (ObjectOutputStream out) throws IOException { out.defaultWriteObject(); ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); ObjectOutputStream oOut = new ObjectOutputStream(byteOut); oOut.writeObject(_clearCreds); try { byt...
[ "public", "void", "writeObject", "(", "ObjectOutputStream", "out", ")", "throws", "IOException", "{", "out", ".", "defaultWriteObject", "(", ")", ";", "ByteArrayOutputStream", "byteOut", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "ObjectOutputStream", "oOut...
A customized AES encrypting write object.
[ "A", "customized", "AES", "encrypting", "write", "object", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/AESAuthRequest.java#L129-L146
41,173
threerings/narya
core/src/main/java/com/threerings/presents/net/AESAuthRequest.java
AESAuthRequest.readObject
@Override public void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _contents = new byte[in.readInt()]; in.read(_contents); }
java
@Override public void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _contents = new byte[in.readInt()]; in.read(_contents); }
[ "@", "Override", "public", "void", "readObject", "(", "ObjectInputStream", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "in", ".", "defaultReadObject", "(", ")", ";", "_contents", "=", "new", "byte", "[", "in", ".", "readInt", "(", ...
Read in our encrypted contents.
[ "Read", "in", "our", "encrypted", "contents", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/AESAuthRequest.java#L151-L158
41,174
threerings/narya
core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java
BlockingCommunicator.connectionFailed
protected synchronized void connectionFailed (final IOException ioe) { // make sure the socket isn't already closed down (meaning we've already dealt with the // failed connection) if (_channel == null) { return; } log.info("Connection failed", ioe); // ...
java
protected synchronized void connectionFailed (final IOException ioe) { // make sure the socket isn't already closed down (meaning we've already dealt with the // failed connection) if (_channel == null) { return; } log.info("Connection failed", ioe); // ...
[ "protected", "synchronized", "void", "connectionFailed", "(", "final", "IOException", "ioe", ")", "{", "// make sure the socket isn't already closed down (meaning we've already dealt with the", "// failed connection)", "if", "(", "_channel", "==", "null", ")", "{", "return", ...
Callback called by the reader or writer thread when something goes awry with our socket connection to the server.
[ "Callback", "called", "by", "the", "reader", "or", "writer", "thread", "when", "something", "goes", "awry", "with", "our", "socket", "connection", "to", "the", "server", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java#L214-L233
41,175
threerings/narya
core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java
BlockingCommunicator.readerDidExit
protected synchronized void readerDidExit () { // clear out our reader reference _reader = null; if (_writer == null) { // there's no writer during authentication, so we may be responsible for closing the // socket channel closeChannel(); // ...
java
protected synchronized void readerDidExit () { // clear out our reader reference _reader = null; if (_writer == null) { // there's no writer during authentication, so we may be responsible for closing the // socket channel closeChannel(); // ...
[ "protected", "synchronized", "void", "readerDidExit", "(", ")", "{", "// clear out our reader reference", "_reader", "=", "null", ";", "if", "(", "_writer", "==", "null", ")", "{", "// there's no writer during authentication, so we may be responsible for closing the", "// soc...
Callback called by the reader thread when it goes away.
[ "Callback", "called", "by", "the", "reader", "thread", "when", "it", "goes", "away", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java#L254-L269
41,176
threerings/narya
core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java
BlockingCommunicator.writerDidExit
protected synchronized void writerDidExit () { // clear out our writer reference _writer = null; log.debug("Writer thread exited."); // let the client observers know that we're logged off notifyClientObservers(new ObserverOps.Session(_client) { @Override protecte...
java
protected synchronized void writerDidExit () { // clear out our writer reference _writer = null; log.debug("Writer thread exited."); // let the client observers know that we're logged off notifyClientObservers(new ObserverOps.Session(_client) { @Override protecte...
[ "protected", "synchronized", "void", "writerDidExit", "(", ")", "{", "// clear out our writer reference", "_writer", "=", "null", ";", "log", ".", "debug", "(", "\"Writer thread exited.\"", ")", ";", "// let the client observers know that we're logged off", "notifyClientObser...
Callback called by the writer thread when it goes away.
[ "Callback", "called", "by", "the", "writer", "thread", "when", "it", "goes", "away", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java#L274-L295
41,177
threerings/narya
core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java
BlockingCommunicator.closeDatagramChannel
protected void closeDatagramChannel () { if (_selector != null) { try { _selector.close(); } catch (IOException ioe) { log.warning("Error closing selector: " + ioe); } _selector = null; } if (_datagramChannel != ...
java
protected void closeDatagramChannel () { if (_selector != null) { try { _selector.close(); } catch (IOException ioe) { log.warning("Error closing selector: " + ioe); } _selector = null; } if (_datagramChannel != ...
[ "protected", "void", "closeDatagramChannel", "(", ")", "{", "if", "(", "_selector", "!=", "null", ")", "{", "try", "{", "_selector", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "log", ".", "warning", "(", "\"Error cl...
Closes the datagram channel.
[ "Closes", "the", "datagram", "channel", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java#L352-L376
41,178
threerings/narya
core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java
BlockingCommunicator.sendMessage
protected void sendMessage (UpstreamMessage msg) throws IOException { if (debugLogMessages()) { log.info("SEND " + msg); } // first we write the message so that we can measure it's length _oout.writeObject(msg); _oout.flush(); // then write the f...
java
protected void sendMessage (UpstreamMessage msg) throws IOException { if (debugLogMessages()) { log.info("SEND " + msg); } // first we write the message so that we can measure it's length _oout.writeObject(msg); _oout.flush(); // then write the f...
[ "protected", "void", "sendMessage", "(", "UpstreamMessage", "msg", ")", "throws", "IOException", "{", "if", "(", "debugLogMessages", "(", ")", ")", "{", "log", ".", "info", "(", "\"SEND \"", "+", "msg", ")", ";", "}", "// first we write the message so that we ca...
Writes the supplied message to the socket.
[ "Writes", "the", "supplied", "message", "to", "the", "socket", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java#L381-L414
41,179
threerings/narya
core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java
BlockingCommunicator.sendDatagram
protected void sendDatagram (UpstreamMessage msg) throws IOException { // reset the stream and write our connection id and hash placeholder _bout.reset(); _uout.writeInt(_client.getConnectionId()); _uout.writeLong(0L); // write the datagram through the sequencer ...
java
protected void sendDatagram (UpstreamMessage msg) throws IOException { // reset the stream and write our connection id and hash placeholder _bout.reset(); _uout.writeInt(_client.getConnectionId()); _uout.writeLong(0L); // write the datagram through the sequencer ...
[ "protected", "void", "sendDatagram", "(", "UpstreamMessage", "msg", ")", "throws", "IOException", "{", "// reset the stream and write our connection id and hash placeholder", "_bout", ".", "reset", "(", ")", ";", "_uout", ".", "writeInt", "(", "_client", ".", "getConnec...
Sends a datagram over the datagram socket.
[ "Sends", "a", "datagram", "over", "the", "datagram", "socket", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java#L430-L463
41,180
threerings/narya
core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java
BlockingCommunicator.throttleOutgoingMessage
protected void throttleOutgoingMessage () { Throttle throttle = _client.getOutgoingMessageThrottle(); synchronized(throttle) { while (throttle.throttleOp()) { try { Thread.sleep(2); } catch (InterruptedException ie) { ...
java
protected void throttleOutgoingMessage () { Throttle throttle = _client.getOutgoingMessageThrottle(); synchronized(throttle) { while (throttle.throttleOp()) { try { Thread.sleep(2); } catch (InterruptedException ie) { ...
[ "protected", "void", "throttleOutgoingMessage", "(", ")", "{", "Throttle", "throttle", "=", "_client", ".", "getOutgoingMessageThrottle", "(", ")", ";", "synchronized", "(", "throttle", ")", "{", "while", "(", "throttle", ".", "throttleOp", "(", ")", ")", "{",...
Throttles an outgoing message operation in a thread-safe manner.
[ "Throttles", "an", "outgoing", "message", "operation", "in", "a", "thread", "-", "safe", "manner", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/BlockingCommunicator.java#L587-L599
41,181
xbib/marc
src/main/java/org/xbib/marc/transformer/field/MarcFieldTransformer.java
MarcFieldTransformer.interpolate
private String interpolate(MarcField marcField, String value) { if (value == null) { return null; } Matcher m = REP.matcher(value); if (m.find()) { return m.replaceAll(Integer.toString(repeatCounter)); } m = NREP.matcher(value); if (m.find(...
java
private String interpolate(MarcField marcField, String value) { if (value == null) { return null; } Matcher m = REP.matcher(value); if (m.find()) { return m.replaceAll(Integer.toString(repeatCounter)); } m = NREP.matcher(value); if (m.find(...
[ "private", "String", "interpolate", "(", "MarcField", "marcField", ",", "String", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "Matcher", "m", "=", "REP", ".", "matcher", "(", "value", ")", ";", "if", "("...
Interpolate variables. @param marcField MARC field @param value the input value @return the interpolated string
[ "Interpolate", "variables", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/transformer/field/MarcFieldTransformer.java#L216-L233
41,182
threerings/narya
core/src/main/java/com/threerings/crowd/data/PlaceConfig.java
PlaceConfig.createController
public PlaceController createController () { Class<?> cclass = getControllerClass(); if (cclass == null) { throw new RuntimeException( "PlaceConfig.createController() must be overridden."); } log.warning("Providing backwards compatibility. PlaceConfig." +...
java
public PlaceController createController () { Class<?> cclass = getControllerClass(); if (cclass == null) { throw new RuntimeException( "PlaceConfig.createController() must be overridden."); } log.warning("Providing backwards compatibility. PlaceConfig." +...
[ "public", "PlaceController", "createController", "(", ")", "{", "Class", "<", "?", ">", "cclass", "=", "getControllerClass", "(", ")", ";", "if", "(", "cclass", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"PlaceConfig.createController() mu...
Create the controller that should be used for this place.
[ "Create", "the", "controller", "that", "should", "be", "used", "for", "this", "place", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/data/PlaceConfig.java#L64-L80
41,183
threerings/narya
core/src/main/java/com/threerings/crowd/data/BodyObject.java
BodyObject.addWhoData
protected void addWhoData (StringBuilder buf) { buf.append(getOid()); if (status != OccupantInfo.ACTIVE) { buf.append(" ").append(getStatusTranslation()); } }
java
protected void addWhoData (StringBuilder buf) { buf.append(getOid()); if (status != OccupantInfo.ACTIVE) { buf.append(" ").append(getStatusTranslation()); } }
[ "protected", "void", "addWhoData", "(", "StringBuilder", "buf", ")", "{", "buf", ".", "append", "(", "getOid", "(", ")", ")", ";", "if", "(", "status", "!=", "OccupantInfo", ".", "ACTIVE", ")", "{", "buf", ".", "append", "(", "\" \"", ")", ".", "appe...
Allows derived classes to add data to the who details.
[ "Allows", "derived", "classes", "to", "add", "data", "to", "the", "who", "details", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/data/BodyObject.java#L217-L223
41,184
threerings/narya
core/src/main/java/com/threerings/presents/server/TimeBaseProvider.java
TimeBaseProvider.init
public static void init (InvocationManager invmgr, RootDObjectManager omgr) { // we'll need these later _invmgr = invmgr; _omgr = omgr; // register a provider instance invmgr.registerProvider(new TimeBaseProvider(), TimeBaseMarshaller.class, GLOBAL_GROUP); }
java
public static void init (InvocationManager invmgr, RootDObjectManager omgr) { // we'll need these later _invmgr = invmgr; _omgr = omgr; // register a provider instance invmgr.registerProvider(new TimeBaseProvider(), TimeBaseMarshaller.class, GLOBAL_GROUP); }
[ "public", "static", "void", "init", "(", "InvocationManager", "invmgr", ",", "RootDObjectManager", "omgr", ")", "{", "// we'll need these later", "_invmgr", "=", "invmgr", ";", "_omgr", "=", "omgr", ";", "// register a provider instance", "invmgr", ".", "registerProvi...
Registers the time provider with the appropriate managers. Called by the presents server at startup.
[ "Registers", "the", "time", "provider", "with", "the", "appropriate", "managers", ".", "Called", "by", "the", "presents", "server", "at", "startup", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/TimeBaseProvider.java#L47-L55
41,185
threerings/narya
core/src/main/java/com/threerings/presents/server/TimeBaseProvider.java
TimeBaseProvider.createTimeBase
public static TimeBaseObject createTimeBase (String timeBase) { TimeBaseObject object = _omgr.registerObject(new TimeBaseObject()); _timeBases.put(timeBase, object); return object; }
java
public static TimeBaseObject createTimeBase (String timeBase) { TimeBaseObject object = _omgr.registerObject(new TimeBaseObject()); _timeBases.put(timeBase, object); return object; }
[ "public", "static", "TimeBaseObject", "createTimeBase", "(", "String", "timeBase", ")", "{", "TimeBaseObject", "object", "=", "_omgr", ".", "registerObject", "(", "new", "TimeBaseObject", "(", ")", ")", ";", "_timeBases", ".", "put", "(", "timeBase", ",", "obj...
Creates a time base object which can subsequently be fetched by the client and used to send delta times. @param timeBase the name of the time base to create. @return the created and registered time base object.
[ "Creates", "a", "time", "base", "object", "which", "can", "subsequently", "be", "fetched", "by", "the", "client", "and", "used", "to", "send", "delta", "times", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/TimeBaseProvider.java#L65-L70
41,186
threerings/narya
core/src/main/java/com/threerings/presents/server/TimeBaseProvider.java
TimeBaseProvider.getTimeOid
public void getTimeOid (ClientObject source, String timeBase, TimeBaseService.GotTimeBaseListener listener) throws InvocationException { // look up the time base object in question TimeBaseObject time = getTimeBase(timeBase); if (time == null) { ...
java
public void getTimeOid (ClientObject source, String timeBase, TimeBaseService.GotTimeBaseListener listener) throws InvocationException { // look up the time base object in question TimeBaseObject time = getTimeBase(timeBase); if (time == null) { ...
[ "public", "void", "getTimeOid", "(", "ClientObject", "source", ",", "String", "timeBase", ",", "TimeBaseService", ".", "GotTimeBaseListener", "listener", ")", "throws", "InvocationException", "{", "// look up the time base object in question", "TimeBaseObject", "time", "=",...
Processes a request from a client to fetch the oid of the specified time object.
[ "Processes", "a", "request", "from", "a", "client", "to", "fetch", "the", "oid", "of", "the", "specified", "time", "object", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/TimeBaseProvider.java#L84-L95
41,187
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.getNodeObjects
public Iterable<NodeObject> getNodeObjects () { return Iterables.filter( Iterables.concat(Collections.singleton(_nodeobj), Iterables.transform(_peers.values(), GET_NODE_OBJECT)), Predicates.notNull()); }
java
public Iterable<NodeObject> getNodeObjects () { return Iterables.filter( Iterables.concat(Collections.singleton(_nodeobj), Iterables.transform(_peers.values(), GET_NODE_OBJECT)), Predicates.notNull()); }
[ "public", "Iterable", "<", "NodeObject", ">", "getNodeObjects", "(", ")", "{", "return", "Iterables", ".", "filter", "(", "Iterables", ".", "concat", "(", "Collections", ".", "singleton", "(", "_nodeobj", ")", ",", "Iterables", ".", "transform", "(", "_peers...
Returns an iterable over our node object and that of our peers.
[ "Returns", "an", "iterable", "over", "our", "node", "object", "and", "that", "of", "our", "peers", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L256-L262
41,188
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.locateClient
public ClientInfo locateClient (final Name key) { return lookupNodeDatum(new Function<NodeObject,ClientInfo>() { public ClientInfo apply (NodeObject nodeobj) { return nodeobj.clients.get(key); } }); }
java
public ClientInfo locateClient (final Name key) { return lookupNodeDatum(new Function<NodeObject,ClientInfo>() { public ClientInfo apply (NodeObject nodeobj) { return nodeobj.clients.get(key); } }); }
[ "public", "ClientInfo", "locateClient", "(", "final", "Name", "key", ")", "{", "return", "lookupNodeDatum", "(", "new", "Function", "<", "NodeObject", ",", "ClientInfo", ">", "(", ")", "{", "public", "ClientInfo", "apply", "(", "NodeObject", "nodeobj", ")", ...
Locates the client with the specified name. Returns null if the client is not logged onto any peer.
[ "Locates", "the", "client", "with", "the", "specified", "name", ".", "Returns", "null", "if", "the", "client", "is", "not", "logged", "onto", "any", "peer", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L416-L423
41,189
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.invokeNodeAction
public void invokeNodeAction (final NodeAction action, final Runnable onDropped) { // if we're not on the dobjmgr thread, get there if (!_omgr.isDispatchThread()) { _omgr.postRunnable(new Runnable() { public void run () { invokeNodeAction(action, onDro...
java
public void invokeNodeAction (final NodeAction action, final Runnable onDropped) { // if we're not on the dobjmgr thread, get there if (!_omgr.isDispatchThread()) { _omgr.postRunnable(new Runnable() { public void run () { invokeNodeAction(action, onDro...
[ "public", "void", "invokeNodeAction", "(", "final", "NodeAction", "action", ",", "final", "Runnable", "onDropped", ")", "{", "// if we're not on the dobjmgr thread, get there", "if", "(", "!", "_omgr", ".", "isDispatchThread", "(", ")", ")", "{", "_omgr", ".", "po...
Invokes the supplied action on this and any other server that it indicates is appropriate. The action will be executed on the distributed object thread, but this method does not need to be called from the distributed object thread. @param onDropped a runnable to be executed if the action was not invoked on the local s...
[ "Invokes", "the", "supplied", "action", "on", "this", "and", "any", "other", "server", "that", "it", "indicates", "is", "appropriate", ".", "The", "action", "will", "be", "executed", "on", "the", "distributed", "object", "thread", "but", "this", "method", "d...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L478-L516
41,190
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.invokeNodeRequest
public <T> void invokeNodeRequest ( final NodeRequest request, final NodeRequestsListener<T> listener) { // if we're not on the dobjmgr thread, get there if (!_omgr.isDispatchThread()) { _omgr.postRunnable(new Runnable() { public void run () { ...
java
public <T> void invokeNodeRequest ( final NodeRequest request, final NodeRequestsListener<T> listener) { // if we're not on the dobjmgr thread, get there if (!_omgr.isDispatchThread()) { _omgr.postRunnable(new Runnable() { public void run () { ...
[ "public", "<", "T", ">", "void", "invokeNodeRequest", "(", "final", "NodeRequest", "request", ",", "final", "NodeRequestsListener", "<", "T", ">", "listener", ")", "{", "// if we're not on the dobjmgr thread, get there", "if", "(", "!", "_omgr", ".", "isDispatchThre...
Invokes the supplied request on all servers in parallel. The request will execute on the distributed object thread, but this method does not need to be called from there. If any one node reports failure, this function reports failure. If all nodes report success, this function will report success.
[ "Invokes", "the", "supplied", "request", "on", "all", "servers", "in", "parallel", ".", "The", "request", "will", "execute", "on", "the", "distributed", "object", "thread", "but", "this", "method", "does", "not", "need", "to", "be", "called", "from", "there"...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L545-L592
41,191
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.invokeNodeRequest
public void invokeNodeRequest (String nodeName, NodeRequest request, InvocationService.ResultListener listener) { invokeNodeRequest(nodeName, flattenRequest(request), listener); }
java
public void invokeNodeRequest (String nodeName, NodeRequest request, InvocationService.ResultListener listener) { invokeNodeRequest(nodeName, flattenRequest(request), listener); }
[ "public", "void", "invokeNodeRequest", "(", "String", "nodeName", ",", "NodeRequest", "request", ",", "InvocationService", ".", "ResultListener", "listener", ")", "{", "invokeNodeRequest", "(", "nodeName", ",", "flattenRequest", "(", "request", ")", ",", "listener",...
Invokes a node request on a specific node and returns the result through the listener.
[ "Invokes", "a", "node", "request", "on", "a", "specific", "node", "and", "returns", "the", "result", "through", "the", "listener", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L614-L618
41,192
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.proxyRemoteObject
public <T extends DObject> void proxyRemoteObject ( String nodeName, final int remoteOid, final ResultListener<Integer> listener) { proxyRemoteObject(new DObjectAddress(nodeName, remoteOid), listener); }
java
public <T extends DObject> void proxyRemoteObject ( String nodeName, final int remoteOid, final ResultListener<Integer> listener) { proxyRemoteObject(new DObjectAddress(nodeName, remoteOid), listener); }
[ "public", "<", "T", "extends", "DObject", ">", "void", "proxyRemoteObject", "(", "String", "nodeName", ",", "final", "int", "remoteOid", ",", "final", "ResultListener", "<", "Integer", ">", "listener", ")", "{", "proxyRemoteObject", "(", "new", "DObjectAddress",...
Initiates a proxy on an object that is managed by the specified peer. The object will be proxied into this server's distributed object space and its local oid reported back to the supplied result listener. <p> Note that proxy requests <em>do not</em> stack like subscription requests. Only one entity must issue a reque...
[ "Initiates", "a", "proxy", "on", "an", "object", "that", "is", "managed", "by", "the", "specified", "peer", ".", "The", "object", "will", "be", "proxied", "into", "this", "server", "s", "distributed", "object", "space", "and", "its", "local", "oid", "repor...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L631-L635
41,193
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.unproxyRemoteObject
public void unproxyRemoteObject (DObjectAddress addr) { Tuple<Subscriber<?>, DObject> bits = _proxies.remove(addr); if (bits == null) { log.warning("Requested to clear unknown proxy", "addr", addr); return; } // If it's local, just remove the subscriber we ad...
java
public void unproxyRemoteObject (DObjectAddress addr) { Tuple<Subscriber<?>, DObject> bits = _proxies.remove(addr); if (bits == null) { log.warning("Requested to clear unknown proxy", "addr", addr); return; } // If it's local, just remove the subscriber we ad...
[ "public", "void", "unproxyRemoteObject", "(", "DObjectAddress", "addr", ")", "{", "Tuple", "<", "Subscriber", "<", "?", ">", ",", "DObject", ">", "bits", "=", "_proxies", ".", "remove", "(", "addr", ")", ";", "if", "(", "bits", "==", "null", ")", "{", ...
Unsubscribes from and clears a proxied object. The caller must be sure that there are no remaining subscribers to the object on this local server.
[ "Unsubscribes", "from", "and", "clears", "a", "proxied", "object", ".", "The", "caller", "must", "be", "sure", "that", "there", "are", "no", "remaining", "subscribers", "to", "the", "object", "on", "this", "local", "server", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L698-L729
41,194
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.getPeerPublicHostName
public String getPeerPublicHostName (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.publicHostName; } PeerNode peer = _peers.get(nodeName); return (peer == null) ? null : peer.getPublicHostName(); }
java
public String getPeerPublicHostName (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.publicHostName; } PeerNode peer = _peers.get(nodeName); return (peer == null) ? null : peer.getPublicHostName(); }
[ "public", "String", "getPeerPublicHostName", "(", "String", "nodeName", ")", "{", "if", "(", "Objects", ".", "equal", "(", "_nodeName", ",", "nodeName", ")", ")", "{", "return", "_self", ".", "publicHostName", ";", "}", "PeerNode", "peer", "=", "_peers", "...
Returns the public hostname to use when connecting to the specified peer or null if the peer is not currently connected to this server.
[ "Returns", "the", "public", "hostname", "to", "use", "when", "connecting", "to", "the", "specified", "peer", "or", "null", "if", "the", "peer", "is", "not", "currently", "connected", "to", "this", "server", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L758-L765
41,195
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.getPeerInternalHostName
public String getPeerInternalHostName (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.hostName; } PeerNode peer = _peers.get(nodeName); return (peer == null) ? null : peer.getInternalHostName(); }
java
public String getPeerInternalHostName (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.hostName; } PeerNode peer = _peers.get(nodeName); return (peer == null) ? null : peer.getInternalHostName(); }
[ "public", "String", "getPeerInternalHostName", "(", "String", "nodeName", ")", "{", "if", "(", "Objects", ".", "equal", "(", "_nodeName", ",", "nodeName", ")", ")", "{", "return", "_self", ".", "hostName", ";", "}", "PeerNode", "peer", "=", "_peers", ".", ...
Returns the internal hostname to use when connecting to the specified peer or null if the peer is not currently connected to this server. Peers connect to one another via their internal hostname. Do not publish this data to clients out on the Internets.
[ "Returns", "the", "internal", "hostname", "to", "use", "when", "connecting", "to", "the", "specified", "peer", "or", "null", "if", "the", "peer", "is", "not", "currently", "connected", "to", "this", "server", ".", "Peers", "connect", "to", "one", "another", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L772-L779
41,196
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.getPeerPort
public int getPeerPort (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.port; } PeerNode peer = _peers.get(nodeName); return (peer == null) ? -1 : peer.getPort(); }
java
public int getPeerPort (String nodeName) { if (Objects.equal(_nodeName, nodeName)) { return _self.port; } PeerNode peer = _peers.get(nodeName); return (peer == null) ? -1 : peer.getPort(); }
[ "public", "int", "getPeerPort", "(", "String", "nodeName", ")", "{", "if", "(", "Objects", ".", "equal", "(", "_nodeName", ",", "nodeName", ")", ")", "{", "return", "_self", ".", "port", ";", "}", "PeerNode", "peer", "=", "_peers", ".", "get", "(", "...
Returns the port on which to connect to the specified peer or -1 if the peer is not currently connected to this server.
[ "Returns", "the", "port", "on", "which", "to", "connect", "to", "the", "specified", "peer", "or", "-", "1", "if", "the", "peer", "is", "not", "currently", "connected", "to", "this", "server", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L785-L792
41,197
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.acquireLock
public void acquireLock (final NodeObject.Lock lock, final ResultListener<String> listener) { // wait until any pending resolution is complete queryLock(lock, new ChainedResultListener<String, String>(listener) { public void requestCompleted (String result) { if (result =...
java
public void acquireLock (final NodeObject.Lock lock, final ResultListener<String> listener) { // wait until any pending resolution is complete queryLock(lock, new ChainedResultListener<String, String>(listener) { public void requestCompleted (String result) { if (result =...
[ "public", "void", "acquireLock", "(", "final", "NodeObject", ".", "Lock", "lock", ",", "final", "ResultListener", "<", "String", ">", "listener", ")", "{", "// wait until any pending resolution is complete", "queryLock", "(", "lock", ",", "new", "ChainedResultListener...
Acquires a lock on a resource shared amongst this node's peers. If the lock is successfully acquired, the supplied listener will receive this node's name. If another node acquires the lock first, then the listener will receive the name of that node.
[ "Acquires", "a", "lock", "on", "a", "resource", "shared", "amongst", "this", "node", "s", "peers", ".", "If", "the", "lock", "is", "successfully", "acquired", "the", "supplied", "listener", "will", "receive", "this", "node", "s", "name", ".", "If", "anothe...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L799-L815
41,198
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.queryLock
public void queryLock (NodeObject.Lock lock, ResultListener<String> listener) { // if it's being resolved, add the listener to the list LockHandler handler = _locks.get(lock); if (handler != null) { handler.listeners.add(listener); return; } // otherw...
java
public void queryLock (NodeObject.Lock lock, ResultListener<String> listener) { // if it's being resolved, add the listener to the list LockHandler handler = _locks.get(lock); if (handler != null) { handler.listeners.add(listener); return; } // otherw...
[ "public", "void", "queryLock", "(", "NodeObject", ".", "Lock", "lock", ",", "ResultListener", "<", "String", ">", "listener", ")", "{", "// if it's being resolved, add the listener to the list", "LockHandler", "handler", "=", "_locks", ".", "get", "(", "lock", ")", ...
Determines the owner of the specified lock, waiting for any resolution to complete before notifying the supplied listener.
[ "Determines", "the", "owner", "of", "the", "specified", "lock", "waiting", "for", "any", "resolution", "to", "complete", "before", "notifying", "the", "supplied", "listener", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L876-L887
41,199
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.addStaleCacheObserver
public void addStaleCacheObserver (String cache, StaleCacheObserver observer) { ObserverList<StaleCacheObserver> list = _cacheobs.get(cache); if (list == null) { list = ObserverList.newFastUnsafe(); _cacheobs.put(cache, list); } list.add(observer); }
java
public void addStaleCacheObserver (String cache, StaleCacheObserver observer) { ObserverList<StaleCacheObserver> list = _cacheobs.get(cache); if (list == null) { list = ObserverList.newFastUnsafe(); _cacheobs.put(cache, list); } list.add(observer); }
[ "public", "void", "addStaleCacheObserver", "(", "String", "cache", ",", "StaleCacheObserver", "observer", ")", "{", "ObserverList", "<", "StaleCacheObserver", ">", "list", "=", "_cacheobs", ".", "get", "(", "cache", ")", ";", "if", "(", "list", "==", "null", ...
Registers a stale cache observer.
[ "Registers", "a", "stale", "cache", "observer", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L974-L982