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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
164,000 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java | SignatureFinder.getSignatures | public Map<Integer, String> getSignatures() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<Integer, String>(signatures));
} | java | public Map<Integer, String> getSignatures() {
ensureRunning();
// Make a copy so callers get an immutable snapshot of the current state.
return Collections.unmodifiableMap(new HashMap<Integer, String>(signatures));
} | [
"public",
"Map",
"<",
"Integer",
",",
"String",
">",
"getSignatures",
"(",
")",
"{",
"ensureRunning",
"(",
")",
";",
"// Make a copy so callers get an immutable snapshot of the current state.",
"return",
"Collections",
".",
"unmodifiableMap",
"(",
"new",
"HashMap",
"<",... | Get the signatures that have been computed for all tracks currently loaded in any player for which we have
been able to obtain all necessary metadata.
@return the signatures that uniquely identify the tracks loaded in each player
@throws IllegalStateException if the SignatureFinder is not running | [
"Get",
"the",
"signatures",
"that",
"have",
"been",
"computed",
"for",
"all",
"tracks",
"currently",
"loaded",
"in",
"any",
"player",
"for",
"which",
"we",
"have",
"been",
"able",
"to",
"obtain",
"all",
"necessary",
"metadata",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java#L143-L147 |
164,001 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java | SignatureFinder.checkExistingTracks | private void checkExistingTracks() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {
if (entry.getKey().hotCue =... | java | private void checkExistingTracks() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {
if (entry.getKey().hotCue =... | [
"private",
"void",
"checkExistingTracks",
"(",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"DeckReference",
",",
"Tr... | Send ourselves "updates" about any tracks that were loaded before we started, since we missed them. | [
"Send",
"ourselves",
"updates",
"about",
"any",
"tracks",
"that",
"were",
"loaded",
"before",
"we",
"started",
"since",
"we",
"missed",
"them",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java#L267-L278 |
164,002 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java | SignatureFinder.digestInteger | private void digestInteger(MessageDigest digest, int value) {
byte[] valueBytes = new byte[4];
Util.numberToBytes(value, valueBytes, 0, 4);
digest.update(valueBytes);
} | java | private void digestInteger(MessageDigest digest, int value) {
byte[] valueBytes = new byte[4];
Util.numberToBytes(value, valueBytes, 0, 4);
digest.update(valueBytes);
} | [
"private",
"void",
"digestInteger",
"(",
"MessageDigest",
"digest",
",",
"int",
"value",
")",
"{",
"byte",
"[",
"]",
"valueBytes",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"Util",
".",
"numberToBytes",
"(",
"value",
",",
"valueBytes",
",",
"0",
",",
"4"... | Helper method to add a Java integer value to a message digest.
@param digest the message digest being built
@param value the integer whose bytes should be included in the digest | [
"Helper",
"method",
"to",
"add",
"a",
"Java",
"integer",
"value",
"to",
"a",
"message",
"digest",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java#L286-L290 |
164,003 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java | SignatureFinder.computeTrackSignature | public String computeTrackSignature(final String title, final SearchableItem artist, final int duration,
final WaveformDetail waveformDetail, final BeatGrid beatGrid) {
final String safeTitle = (title == null)? "" : title;
final String artistName = (artist == null... | java | public String computeTrackSignature(final String title, final SearchableItem artist, final int duration,
final WaveformDetail waveformDetail, final BeatGrid beatGrid) {
final String safeTitle = (title == null)? "" : title;
final String artistName = (artist == null... | [
"public",
"String",
"computeTrackSignature",
"(",
"final",
"String",
"title",
",",
"final",
"SearchableItem",
"artist",
",",
"final",
"int",
"duration",
",",
"final",
"WaveformDetail",
"waveformDetail",
",",
"final",
"BeatGrid",
"beatGrid",
")",
"{",
"final",
"Str... | Calculate the signature by which we can reliably recognize a loaded track.
@param title the track title
@param artist the track artist, or {@code null} if there is no artist
@param duration the duration of the track in seconds
@param waveformDetail the monochrome waveform detail of the track
@param beatGrid the beat g... | [
"Calculate",
"the",
"signature",
"by",
"which",
"we",
"can",
"reliably",
"recognize",
"a",
"loaded",
"track",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java#L303-L338 |
164,004 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java | SignatureFinder.handleUpdate | private void handleUpdate(final int player) {
final TrackMetadata metadata = MetadataFinder.getInstance().getLatestMetadataFor(player);
final WaveformDetail waveformDetail = WaveformFinder.getInstance().getLatestDetailFor(player);
final BeatGrid beatGrid = BeatGridFinder.getInstance().getLatestB... | java | private void handleUpdate(final int player) {
final TrackMetadata metadata = MetadataFinder.getInstance().getLatestMetadataFor(player);
final WaveformDetail waveformDetail = WaveformFinder.getInstance().getLatestDetailFor(player);
final BeatGrid beatGrid = BeatGridFinder.getInstance().getLatestB... | [
"private",
"void",
"handleUpdate",
"(",
"final",
"int",
"player",
")",
"{",
"final",
"TrackMetadata",
"metadata",
"=",
"MetadataFinder",
".",
"getInstance",
"(",
")",
".",
"getLatestMetadataFor",
"(",
"player",
")",
";",
"final",
"WaveformDetail",
"waveformDetail"... | We have reason to believe we might have enough information to calculate a signature for the track loaded on a
player. Verify that, and if so, perform the computation and record and report the new signature. | [
"We",
"have",
"reason",
"to",
"believe",
"we",
"might",
"have",
"enough",
"information",
"to",
"calculate",
"a",
"signature",
"for",
"the",
"track",
"loaded",
"on",
"a",
"player",
".",
"Verify",
"that",
"and",
"if",
"so",
"perform",
"the",
"computation",
"... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java#L344-L356 |
164,005 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java | SignatureFinder.stop | public synchronized void stop () {
if (isRunning()) {
MetadataFinder.getInstance().removeTrackMetadataListener(metadataListener);
WaveformFinder.getInstance().removeWaveformListener(waveformListener);
BeatGridFinder.getInstance().removeBeatGridListener(beatGridListener);
... | java | public synchronized void stop () {
if (isRunning()) {
MetadataFinder.getInstance().removeTrackMetadataListener(metadataListener);
WaveformFinder.getInstance().removeWaveformListener(waveformListener);
BeatGridFinder.getInstance().removeBeatGridListener(beatGridListener);
... | [
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"MetadataFinder",
".",
"getInstance",
"(",
")",
".",
"removeTrackMetadataListener",
"(",
"metadataListener",
")",
";",
"WaveformFinder",
".",
"getInstance",
"(... | Stop finding signatures for all active players. | [
"Stop",
"finding",
"signatures",
"for",
"all",
"active",
"players",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SignatureFinder.java#L406-L429 |
164,006 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java | DeviceFinder.expireDevices | private void expireDevices() {
long now = System.currentTimeMillis();
// Make a copy so we don't have to worry about concurrent modification.
Map<InetAddress, DeviceAnnouncement> copy = new HashMap<InetAddress, DeviceAnnouncement>(devices);
for (Map.Entry<InetAddress, DeviceAnnouncement>... | java | private void expireDevices() {
long now = System.currentTimeMillis();
// Make a copy so we don't have to worry about concurrent modification.
Map<InetAddress, DeviceAnnouncement> copy = new HashMap<InetAddress, DeviceAnnouncement>(devices);
for (Map.Entry<InetAddress, DeviceAnnouncement>... | [
"private",
"void",
"expireDevices",
"(",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// Make a copy so we don't have to worry about concurrent modification.",
"Map",
"<",
"InetAddress",
",",
"DeviceAnnouncement",
">",
"copy",
"=",
... | Remove any device announcements that are so old that the device seems to have gone away. | [
"Remove",
"any",
"device",
"announcements",
"that",
"are",
"so",
"old",
"that",
"the",
"device",
"seems",
"to",
"have",
"gone",
"away",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java#L98-L111 |
164,007 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java | DeviceFinder.updateDevices | private void updateDevices(DeviceAnnouncement announcement) {
firstDeviceTime.compareAndSet(0, System.currentTimeMillis());
devices.put(announcement.getAddress(), announcement);
} | java | private void updateDevices(DeviceAnnouncement announcement) {
firstDeviceTime.compareAndSet(0, System.currentTimeMillis());
devices.put(announcement.getAddress(), announcement);
} | [
"private",
"void",
"updateDevices",
"(",
"DeviceAnnouncement",
"announcement",
")",
"{",
"firstDeviceTime",
".",
"compareAndSet",
"(",
"0",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"devices",
".",
"put",
"(",
"announcement",
".",
"getAddress"... | Record a device announcement in the devices map, so we know whe saw it.
@param announcement the announcement to be recorded | [
"Record",
"a",
"device",
"announcement",
"in",
"the",
"devices",
"map",
"so",
"we",
"know",
"whe",
"saw",
"it",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java#L118-L121 |
164,008 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java | DeviceFinder.start | public synchronized void start() throws SocketException {
if (!isRunning()) {
socket.set(new DatagramSocket(ANNOUNCEMENT_PORT));
startTime.set(System.currentTimeMillis());
deliverLifecycleAnnouncement(logger, true);
final byte[] buffer = new byte[512];
... | java | public synchronized void start() throws SocketException {
if (!isRunning()) {
socket.set(new DatagramSocket(ANNOUNCEMENT_PORT));
startTime.set(System.currentTimeMillis());
deliverLifecycleAnnouncement(logger, true);
final byte[] buffer = new byte[512];
... | [
"public",
"synchronized",
"void",
"start",
"(",
")",
"throws",
"SocketException",
"{",
"if",
"(",
"!",
"isRunning",
"(",
")",
")",
"{",
"socket",
".",
"set",
"(",
"new",
"DatagramSocket",
"(",
"ANNOUNCEMENT_PORT",
")",
")",
";",
"startTime",
".",
"set",
... | Start listening for device announcements and keeping track of the DJ Link devices visible on the network.
If already listening, has no effect.
@throws SocketException if the socket to listen on port 50000 cannot be created | [
"Start",
"listening",
"for",
"device",
"announcements",
"and",
"keeping",
"track",
"of",
"the",
"DJ",
"Link",
"devices",
"visible",
"on",
"the",
"network",
".",
"If",
"already",
"listening",
"has",
"no",
"effect",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java#L180-L245 |
164,009 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java | DeviceFinder.stop | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
final Set<DeviceAnnouncement> lastDevices = getCurrentDevices();
socket.get().close();
socket.set(null);
devices.clear();
firstDeviceTime.set(0);
// ... | java | @SuppressWarnings("WeakerAccess")
public synchronized void stop() {
if (isRunning()) {
final Set<DeviceAnnouncement> lastDevices = getCurrentDevices();
socket.get().close();
socket.set(null);
devices.clear();
firstDeviceTime.set(0);
// ... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"isRunning",
"(",
")",
")",
"{",
"final",
"Set",
"<",
"DeviceAnnouncement",
">",
"lastDevices",
"=",
"getCurrentDevices",
"(",
")",
";"... | Stop listening for device announcements. Also discard any announcements which had been received, and
notify any registered listeners that those devices have been lost. | [
"Stop",
"listening",
"for",
"device",
"announcements",
".",
"Also",
"discard",
"any",
"announcements",
"which",
"had",
"been",
"received",
"and",
"notify",
"any",
"registered",
"listeners",
"that",
"those",
"devices",
"have",
"been",
"lost",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java#L251-L270 |
164,010 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java | DeviceFinder.deliverFoundAnnouncement | private void deliverFoundAnnouncement(final DeviceAnnouncement announcement) {
for (final DeviceAnnouncementListener listener : getDeviceAnnouncementListeners()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
... | java | private void deliverFoundAnnouncement(final DeviceAnnouncement announcement) {
for (final DeviceAnnouncementListener listener : getDeviceAnnouncementListeners()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
... | [
"private",
"void",
"deliverFoundAnnouncement",
"(",
"final",
"DeviceAnnouncement",
"announcement",
")",
"{",
"for",
"(",
"final",
"DeviceAnnouncementListener",
"listener",
":",
"getDeviceAnnouncementListeners",
"(",
")",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"... | Send a device found announcement to all registered listeners.
@param announcement the message announcing the new device | [
"Send",
"a",
"device",
"found",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java#L362-L375 |
164,011 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java | DeviceFinder.deliverLostAnnouncement | private void deliverLostAnnouncement(final DeviceAnnouncement announcement) {
for (final DeviceAnnouncementListener listener : getDeviceAnnouncementListeners()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
... | java | private void deliverLostAnnouncement(final DeviceAnnouncement announcement) {
for (final DeviceAnnouncementListener listener : getDeviceAnnouncementListeners()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
... | [
"private",
"void",
"deliverLostAnnouncement",
"(",
"final",
"DeviceAnnouncement",
"announcement",
")",
"{",
"for",
"(",
"final",
"DeviceAnnouncementListener",
"listener",
":",
"getDeviceAnnouncementListeners",
"(",
")",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"(... | Send a device lost announcement to all registered listeners.
@param announcement the last message received from the vanished device | [
"Send",
"a",
"device",
"lost",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/DeviceFinder.java#L382-L395 |
164,012 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.performSetupExchange | private void performSetupExchange() throws IOException {
Message setupRequest = new Message(0xfffffffeL, Message.KnownType.SETUP_REQ, new NumberField(posingAsPlayer, 4));
sendMessage(setupRequest);
Message response = Message.read(is);
if (response.knownType != Message.KnownType.MENU_AVAI... | java | private void performSetupExchange() throws IOException {
Message setupRequest = new Message(0xfffffffeL, Message.KnownType.SETUP_REQ, new NumberField(posingAsPlayer, 4));
sendMessage(setupRequest);
Message response = Message.read(is);
if (response.knownType != Message.KnownType.MENU_AVAI... | [
"private",
"void",
"performSetupExchange",
"(",
")",
"throws",
"IOException",
"{",
"Message",
"setupRequest",
"=",
"new",
"Message",
"(",
"0xfffffffe",
"L",
",",
"Message",
".",
"KnownType",
".",
"SETUP_REQ",
",",
"new",
"NumberField",
"(",
"posingAsPlayer",
","... | Exchanges the initial fully-formed messages which establishes the transaction context for queries to
the dbserver.
@throws IOException if there is a problem during the exchange | [
"Exchanges",
"the",
"initial",
"fully",
"-",
"formed",
"messages",
"which",
"establishes",
"the",
"transaction",
"context",
"for",
"queries",
"to",
"the",
"dbserver",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L117-L135 |
164,013 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.performTeardownExchange | private void performTeardownExchange() throws IOException {
Message teardownRequest = new Message(0xfffffffeL, Message.KnownType.TEARDOWN_REQ);
sendMessage(teardownRequest);
// At this point, the server closes the connection from its end, so we can’t read any more.
} | java | private void performTeardownExchange() throws IOException {
Message teardownRequest = new Message(0xfffffffeL, Message.KnownType.TEARDOWN_REQ);
sendMessage(teardownRequest);
// At this point, the server closes the connection from its end, so we can’t read any more.
} | [
"private",
"void",
"performTeardownExchange",
"(",
")",
"throws",
"IOException",
"{",
"Message",
"teardownRequest",
"=",
"new",
"Message",
"(",
"0xfffffffe",
"L",
",",
"Message",
".",
"KnownType",
".",
"TEARDOWN_REQ",
")",
";",
"sendMessage",
"(",
"teardownRequest... | Exchanges the final messages which politely report our intention to disconnect from the dbserver. | [
"Exchanges",
"the",
"final",
"messages",
"which",
"politely",
"report",
"our",
"intention",
"to",
"disconnect",
"from",
"the",
"dbserver",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L140-L144 |
164,014 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.close | void close() {
try {
performTeardownExchange();
} catch (IOException e) {
logger.warn("Problem reporting our intention to close the dbserver connection", e);
}
try {
channel.close();
} catch (IOException e) {
logger.warn("Problem cl... | java | void close() {
try {
performTeardownExchange();
} catch (IOException e) {
logger.warn("Problem reporting our intention to close the dbserver connection", e);
}
try {
channel.close();
} catch (IOException e) {
logger.warn("Problem cl... | [
"void",
"close",
"(",
")",
"{",
"try",
"{",
"performTeardownExchange",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Problem reporting our intention to close the dbserver connection\"",
",",
"e",
")",
";",
"}",
... | Closes the connection to the dbserver. This instance can no longer be used after this action. | [
"Closes",
"the",
"connection",
"to",
"the",
"dbserver",
".",
"This",
"instance",
"can",
"no",
"longer",
"be",
"used",
"after",
"this",
"action",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L160-L186 |
164,015 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.sendField | @SuppressWarnings("SameParameterValue")
private void sendField(Field field) throws IOException {
if (isConnected()) {
try {
field.write(channel);
} catch (IOException e) {
logger.warn("Problem trying to write field to dbserver, closing connection", e);... | java | @SuppressWarnings("SameParameterValue")
private void sendField(Field field) throws IOException {
if (isConnected()) {
try {
field.write(channel);
} catch (IOException e) {
logger.warn("Problem trying to write field to dbserver, closing connection", e);... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"private",
"void",
"sendField",
"(",
"Field",
"field",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isConnected",
"(",
")",
")",
"{",
"try",
"{",
"field",
".",
"write",
"(",
"channel",
")",
";"... | Attempt to send the specified field to the dbserver.
This low-level function is available only to the package itself for use in setting up the connection. It was
previously also used for sending parts of larger-scale messages, but because that sometimes led to them being
fragmented into multiple network packets, and Wi... | [
"Attempt",
"to",
"send",
"the",
"specified",
"field",
"to",
"the",
"dbserver",
".",
"This",
"low",
"-",
"level",
"function",
"is",
"available",
"only",
"to",
"the",
"package",
"itself",
"for",
"use",
"in",
"setting",
"up",
"the",
"connection",
".",
"It",
... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L199-L212 |
164,016 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.sendMessage | private void sendMessage(Message message) throws IOException {
logger.debug("Sending> {}", message);
int totalSize = 0;
for (Field field : message.fields) {
totalSize += field.getBytes().remaining();
}
ByteBuffer combined = ByteBuffer.allocate(totalSize);
for ... | java | private void sendMessage(Message message) throws IOException {
logger.debug("Sending> {}", message);
int totalSize = 0;
for (Field field : message.fields) {
totalSize += field.getBytes().remaining();
}
ByteBuffer combined = ByteBuffer.allocate(totalSize);
for ... | [
"private",
"void",
"sendMessage",
"(",
"Message",
"message",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"Sending> {}\"",
",",
"message",
")",
";",
"int",
"totalSize",
"=",
"0",
";",
"for",
"(",
"Field",
"field",
":",
"message",
".",
... | Sends a message to the dbserver, first assembling it into a single byte buffer so that it can be sent as
a single packet.
@param message the message to be sent
@throws IOException if there is a problem sending it | [
"Sends",
"a",
"message",
"to",
"the",
"dbserver",
"first",
"assembling",
"it",
"into",
"a",
"single",
"byte",
"buffer",
"so",
"that",
"it",
"can",
"be",
"sent",
"as",
"a",
"single",
"packet",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L231-L244 |
164,017 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.simpleRequest | public synchronized Message simpleRequest(Message.KnownType requestType, Message.KnownType responseType,
Field... arguments)
throws IOException {
final NumberField transaction = assignTransactionNumber();
final Message request = new Message(trans... | java | public synchronized Message simpleRequest(Message.KnownType requestType, Message.KnownType responseType,
Field... arguments)
throws IOException {
final NumberField transaction = assignTransactionNumber();
final Message request = new Message(trans... | [
"public",
"synchronized",
"Message",
"simpleRequest",
"(",
"Message",
".",
"KnownType",
"requestType",
",",
"Message",
".",
"KnownType",
"responseType",
",",
"Field",
"...",
"arguments",
")",
"throws",
"IOException",
"{",
"final",
"NumberField",
"transaction",
"=",
... | Send a request that expects a single message as its response, then read and return that response.
@param requestType identifies what kind of request to send
@param responseType identifies the type of response we expect, or {@code null} if we’ll accept anything
@param arguments The argument fields to send in the reques... | [
"Send",
"a",
"request",
"that",
"expects",
"a",
"single",
"message",
"as",
"its",
"response",
"then",
"read",
"and",
"return",
"that",
"response",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L345-L361 |
164,018 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.menuRequestTyped | public synchronized Message menuRequestTyped(Message.KnownType requestType, Message.MenuIdentifier targetMenu,
CdjStatus.TrackSourceSlot slot, CdjStatus.TrackType trackType, Field... arguments)
throws IOException {
if (!menuLock.isHeldByCurrentThread... | java | public synchronized Message menuRequestTyped(Message.KnownType requestType, Message.MenuIdentifier targetMenu,
CdjStatus.TrackSourceSlot slot, CdjStatus.TrackType trackType, Field... arguments)
throws IOException {
if (!menuLock.isHeldByCurrentThread... | [
"public",
"synchronized",
"Message",
"menuRequestTyped",
"(",
"Message",
".",
"KnownType",
"requestType",
",",
"Message",
".",
"MenuIdentifier",
"targetMenu",
",",
"CdjStatus",
".",
"TrackSourceSlot",
"slot",
",",
"CdjStatus",
".",
"TrackType",
"trackType",
",",
"Fi... | Send a request for a menu that we will retrieve items from in subsequent requests, when the request must reflect
the actual type of track being asked about.
@param requestType identifies what kind of menu request to send
@param targetMenu the destination for the response to this query
@param slot the media library of ... | [
"Send",
"a",
"request",
"for",
"a",
"menu",
"that",
"we",
"will",
"retrieve",
"items",
"from",
"in",
"subsequent",
"requests",
"when",
"the",
"request",
"must",
"reflect",
"the",
"actual",
"type",
"of",
"track",
"being",
"asked",
"about",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L403-L422 |
164,019 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SlotReference.java | SlotReference.getSlotReference | @SuppressWarnings("WeakerAccess")
public static synchronized SlotReference getSlotReference(int player, CdjStatus.TrackSourceSlot slot) {
Map<CdjStatus.TrackSourceSlot, SlotReference> playerMap = instances.get(player);
if (playerMap == null) {
playerMap = new HashMap<CdjStatus.TrackSourc... | java | @SuppressWarnings("WeakerAccess")
public static synchronized SlotReference getSlotReference(int player, CdjStatus.TrackSourceSlot slot) {
Map<CdjStatus.TrackSourceSlot, SlotReference> playerMap = instances.get(player);
if (playerMap == null) {
playerMap = new HashMap<CdjStatus.TrackSourc... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"static",
"synchronized",
"SlotReference",
"getSlotReference",
"(",
"int",
"player",
",",
"CdjStatus",
".",
"TrackSourceSlot",
"slot",
")",
"{",
"Map",
"<",
"CdjStatus",
".",
"TrackSourceSlot",
",",
... | Get a unique reference to a media slot on the network from which tracks can be loaded.
@param player the player in which the slot is found
@param slot the specific type of the slot
@return the instance that will always represent the specified slot
@throws NullPointerException if {@code slot} is {@code null} | [
"Get",
"a",
"unique",
"reference",
"to",
"a",
"media",
"slot",
"on",
"the",
"network",
"from",
"which",
"tracks",
"can",
"be",
"loaded",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SlotReference.java#L56-L69 |
164,020 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/SlotReference.java | SlotReference.getSlotReference | @SuppressWarnings("WeakerAccess")
public static SlotReference getSlotReference(DataReference dataReference) {
return getSlotReference(dataReference.player, dataReference.slot);
} | java | @SuppressWarnings("WeakerAccess")
public static SlotReference getSlotReference(DataReference dataReference) {
return getSlotReference(dataReference.player, dataReference.slot);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"static",
"SlotReference",
"getSlotReference",
"(",
"DataReference",
"dataReference",
")",
"{",
"return",
"getSlotReference",
"(",
"dataReference",
".",
"player",
",",
"dataReference",
".",
"slot",
")",
... | Get a unique reference to the media slot on the network from which the specified data was loaded.
@param dataReference the data whose media slot is of interest
@return the instance that will always represent the slot associated with the specified data | [
"Get",
"a",
"unique",
"reference",
"to",
"the",
"media",
"slot",
"on",
"the",
"network",
"from",
"which",
"the",
"specified",
"data",
"was",
"loaded",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/SlotReference.java#L78-L81 |
164,021 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/Beat.java | Beat.isTempoMaster | @Override
public boolean isTempoMaster() {
DeviceUpdate master = VirtualCdj.getInstance().getTempoMaster();
return (master != null) && master.getAddress().equals(address);
} | java | @Override
public boolean isTempoMaster() {
DeviceUpdate master = VirtualCdj.getInstance().getTempoMaster();
return (master != null) && master.getAddress().equals(address);
} | [
"@",
"Override",
"public",
"boolean",
"isTempoMaster",
"(",
")",
"{",
"DeviceUpdate",
"master",
"=",
"VirtualCdj",
".",
"getInstance",
"(",
")",
".",
"getTempoMaster",
"(",
")",
";",
"return",
"(",
"master",
"!=",
"null",
")",
"&&",
"master",
".",
"getAddr... | Was this beat sent by the current tempo master?
@return {@code true} if the device that sent this beat is the master
@throws IllegalStateException if the {@link VirtualCdj} is not running | [
"Was",
"this",
"beat",
"sent",
"by",
"the",
"current",
"tempo",
"master?"
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/Beat.java#L106-L110 |
164,022 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/LifecycleParticipant.java | LifecycleParticipant.deliverLifecycleAnnouncement | protected void deliverLifecycleAnnouncement(final Logger logger, final boolean starting) {
new Thread(new Runnable() {
@Override
public void run() {
for (final LifecycleListener listener : getLifecycleListeners()) {
try {
if (st... | java | protected void deliverLifecycleAnnouncement(final Logger logger, final boolean starting) {
new Thread(new Runnable() {
@Override
public void run() {
for (final LifecycleListener listener : getLifecycleListeners()) {
try {
if (st... | [
"protected",
"void",
"deliverLifecycleAnnouncement",
"(",
"final",
"Logger",
"logger",
",",
"final",
"boolean",
"starting",
")",
"{",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"for",
"(... | Send a lifecycle announcement to all registered listeners.
@param logger the logger to use, so the log entry shows as belonging to the proper subclass.
@param starting will be {@code true} if the DeviceFinder is starting, {@code false} if it is stopping. | [
"Send",
"a",
"lifecycle",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/LifecycleParticipant.java#L69-L86 |
164,023 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/CrateDigger.java | CrateDigger.mountPath | private String mountPath(CdjStatus.TrackSourceSlot slot) {
switch (slot) {
case SD_SLOT: return "/B/";
case USB_SLOT: return "/C/";
}
throw new IllegalArgumentException("Don't know how to NFS mount filesystem for slot " + slot);
} | java | private String mountPath(CdjStatus.TrackSourceSlot slot) {
switch (slot) {
case SD_SLOT: return "/B/";
case USB_SLOT: return "/C/";
}
throw new IllegalArgumentException("Don't know how to NFS mount filesystem for slot " + slot);
} | [
"private",
"String",
"mountPath",
"(",
"CdjStatus",
".",
"TrackSourceSlot",
"slot",
")",
"{",
"switch",
"(",
"slot",
")",
"{",
"case",
"SD_SLOT",
":",
"return",
"\"/B/\"",
";",
"case",
"USB_SLOT",
":",
"return",
"\"/C/\"",
";",
"}",
"throw",
"new",
"Illega... | Return the filesystem path needed to mount the NFS filesystem associated with a particular media slot.
@param slot the slot whose filesystem is desired
@return the path to use in the NFS mount request to access the files mounted in that slot
@throws IllegalArgumentException if it is a slot that we don't know how to ... | [
"Return",
"the",
"filesystem",
"path",
"needed",
"to",
"mount",
"the",
"NFS",
"filesystem",
"associated",
"with",
"a",
"particular",
"media",
"slot",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/CrateDigger.java#L189-L195 |
164,024 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/CrateDigger.java | CrateDigger.deliverDatabaseUpdate | private void deliverDatabaseUpdate(SlotReference slot, Database database, boolean available) {
for (final DatabaseListener listener : getDatabaseListeners()) {
try {
if (available) {
listener.databaseMounted(slot, database);
} else {
... | java | private void deliverDatabaseUpdate(SlotReference slot, Database database, boolean available) {
for (final DatabaseListener listener : getDatabaseListeners()) {
try {
if (available) {
listener.databaseMounted(slot, database);
} else {
... | [
"private",
"void",
"deliverDatabaseUpdate",
"(",
"SlotReference",
"slot",
",",
"Database",
"database",
",",
"boolean",
"available",
")",
"{",
"for",
"(",
"final",
"DatabaseListener",
"listener",
":",
"getDatabaseListeners",
"(",
")",
")",
"{",
"try",
"{",
"if",
... | Send a database announcement to all registered listeners.
@param slot the media slot whose database availability has changed
@param database the database whose relevance has changed
@param available if {@code} true, the database is newly available, otherwise it is no longer relevant | [
"Send",
"a",
"database",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/CrateDigger.java#L726-L738 |
164,025 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java | WaveformPreviewComponent.delegatingRepaint | @SuppressWarnings("SameParameterValue")
private void delegatingRepaint(int x, int y, int width, int height) {
final RepaintDelegate delegate = repaintDelegate.get();
if (delegate != null) {
//logger.info("Delegating repaint: " + x + ", " + y + ", " + width + ", " + height);
d... | java | @SuppressWarnings("SameParameterValue")
private void delegatingRepaint(int x, int y, int width, int height) {
final RepaintDelegate delegate = repaintDelegate.get();
if (delegate != null) {
//logger.info("Delegating repaint: " + x + ", " + y + ", " + width + ", " + height);
d... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"private",
"void",
"delegatingRepaint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"final",
"RepaintDelegate",
"delegate",
"=",
"repaintDelegate",
".",
"ge... | Determine whether we should use the normal repaint process, or delegate that to another component that is
hosting us in a soft-loaded manner to save memory.
@param x the left edge of the region that we want to have redrawn
@param y the top edge of the region that we want to have redrawn
@param width the width of the r... | [
"Determine",
"whether",
"we",
"should",
"use",
"the",
"normal",
"repaint",
"process",
"or",
"delegate",
"that",
"to",
"another",
"component",
"that",
"is",
"hosting",
"us",
"in",
"a",
"soft",
"-",
"loaded",
"manner",
"to",
"save",
"memory",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java#L225-L235 |
164,026 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java | WaveformPreviewComponent.updateWaveform | private void updateWaveform(WaveformPreview preview) {
this.preview.set(preview);
if (preview == null) {
waveformImage.set(null);
} else {
BufferedImage image = new BufferedImage(preview.segmentCount, preview.maxHeight, BufferedImage.TYPE_INT_RGB);
Graphics g ... | java | private void updateWaveform(WaveformPreview preview) {
this.preview.set(preview);
if (preview == null) {
waveformImage.set(null);
} else {
BufferedImage image = new BufferedImage(preview.segmentCount, preview.maxHeight, BufferedImage.TYPE_INT_RGB);
Graphics g ... | [
"private",
"void",
"updateWaveform",
"(",
"WaveformPreview",
"preview",
")",
"{",
"this",
".",
"preview",
".",
"set",
"(",
"preview",
")",
";",
"if",
"(",
"preview",
"==",
"null",
")",
"{",
"waveformImage",
".",
"set",
"(",
"null",
")",
";",
"}",
"else... | Create an image of the proper size to hold a new waveform preview image and draw it. | [
"Create",
"an",
"image",
"of",
"the",
"proper",
"size",
"to",
"hold",
"a",
"new",
"waveform",
"preview",
"image",
"and",
"draw",
"it",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java#L420-L439 |
164,027 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java | WaveformPreview.getMaxHeight | private int getMaxHeight() {
int result = 0;
for (int i = 0; i < segmentCount; i++) {
result = Math.max(result, segmentHeight(i, false));
}
return result;
} | java | private int getMaxHeight() {
int result = 0;
for (int i = 0; i < segmentCount; i++) {
result = Math.max(result, segmentHeight(i, false));
}
return result;
} | [
"private",
"int",
"getMaxHeight",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"segmentCount",
";",
"i",
"++",
")",
"{",
"result",
"=",
"Math",
".",
"max",
"(",
"result",
",",
"segmentHeight",
"(... | Scan the segments to find the largest height value present.
@return the largest waveform height anywhere in the preview. | [
"Scan",
"the",
"segments",
"to",
"find",
"the",
"largest",
"height",
"value",
"present",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java#L110-L116 |
164,028 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java | WaveformPreview.segmentHeight | @SuppressWarnings("WeakerAccess")
public int segmentHeight(final int segment, final boolean front) {
final ByteBuffer bytes = getData();
if (isColor) {
final int base = segment * 6;
final int frontHeight = Util.unsign(bytes.get(base + 5));
if (front) {
... | java | @SuppressWarnings("WeakerAccess")
public int segmentHeight(final int segment, final boolean front) {
final ByteBuffer bytes = getData();
if (isColor) {
final int base = segment * 6;
final int frontHeight = Util.unsign(bytes.get(base + 5));
if (front) {
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"int",
"segmentHeight",
"(",
"final",
"int",
"segment",
",",
"final",
"boolean",
"front",
")",
"{",
"final",
"ByteBuffer",
"bytes",
"=",
"getData",
"(",
")",
";",
"if",
"(",
"isColor",
")",
"... | Determine the height of the preview given an index into it.
@param segment the index of the waveform preview segment to examine
@param front if {@code true} the height of the front (brighter) segment of a color waveform preview is returned,
otherwise the height of the back (dimmer) segment is returned. Has no effect f... | [
"Determine",
"the",
"height",
"of",
"the",
"preview",
"given",
"an",
"index",
"into",
"it",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java#L218-L232 |
164,029 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java | WaveformPreview.segmentColor | @SuppressWarnings("WeakerAccess")
public Color segmentColor(final int segment, final boolean front) {
final ByteBuffer bytes = getData();
if (isColor) {
final int base = segment * 6;
final int backHeight = segmentHeight(segment, false);
if (backHeight == 0) {
... | java | @SuppressWarnings("WeakerAccess")
public Color segmentColor(final int segment, final boolean front) {
final ByteBuffer bytes = getData();
if (isColor) {
final int base = segment * 6;
final int backHeight = segmentHeight(segment, false);
if (backHeight == 0) {
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"Color",
"segmentColor",
"(",
"final",
"int",
"segment",
",",
"final",
"boolean",
"front",
")",
"{",
"final",
"ByteBuffer",
"bytes",
"=",
"getData",
"(",
")",
";",
"if",
"(",
"isColor",
")",
... | Determine the color of the waveform given an index into it.
@param segment the index of the first waveform byte to examine
@param front if {@code true} the front (brighter) segment of a color waveform preview is returned,
otherwise the back (dimmer) segment is returned. Has no effect for blue previews.
@return the co... | [
"Determine",
"the",
"color",
"of",
"the",
"waveform",
"given",
"an",
"index",
"into",
"it",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java#L244-L262 |
164,030 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/MediaDetails.java | MediaDetails.hasChanged | public boolean hasChanged(MediaDetails originalMedia) {
if (!hashKey().equals(originalMedia.hashKey())) {
throw new IllegalArgumentException("Can't compare media details with different hashKey values");
}
return playlistCount != originalMedia.playlistCount || trackCount != originalMe... | java | public boolean hasChanged(MediaDetails originalMedia) {
if (!hashKey().equals(originalMedia.hashKey())) {
throw new IllegalArgumentException("Can't compare media details with different hashKey values");
}
return playlistCount != originalMedia.playlistCount || trackCount != originalMe... | [
"public",
"boolean",
"hasChanged",
"(",
"MediaDetails",
"originalMedia",
")",
"{",
"if",
"(",
"!",
"hashKey",
"(",
")",
".",
"equals",
"(",
"originalMedia",
".",
"hashKey",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't co... | Check whether the media seems to have changed since a saved version of it was used. We ignore changes in
free space because those probably just reflect history entries being added.
@param originalMedia the media details when information about it was saved
@return true if there have been detectable significant change... | [
"Check",
"whether",
"the",
"media",
"seems",
"to",
"have",
"changed",
"since",
"a",
"saved",
"version",
"of",
"it",
"was",
"used",
".",
"We",
"ignore",
"changes",
"in",
"free",
"space",
"because",
"those",
"probably",
"just",
"reflect",
"history",
"entries",... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/MediaDetails.java#L183-L188 |
164,031 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/BinaryField.java | BinaryField.getValueAsArray | public byte[] getValueAsArray() {
ByteBuffer buffer = getValue();
byte[] result = new byte[buffer.remaining()];
buffer.get(result);
return result;
} | java | public byte[] getValueAsArray() {
ByteBuffer buffer = getValue();
byte[] result = new byte[buffer.remaining()];
buffer.get(result);
return result;
} | [
"public",
"byte",
"[",
"]",
"getValueAsArray",
"(",
")",
"{",
"ByteBuffer",
"buffer",
"=",
"getValue",
"(",
")",
";",
"byte",
"[",
"]",
"result",
"=",
"new",
"byte",
"[",
"buffer",
".",
"remaining",
"(",
")",
"]",
";",
"buffer",
".",
"get",
"(",
"r... | Get the bytes which represent the payload of this field, without the leading type tag and length header, as
a newly-allocated byte array.
@return a new byte array containing a copy of the bytes this field contains | [
"Get",
"the",
"bytes",
"which",
"represent",
"the",
"payload",
"of",
"this",
"field",
"without",
"the",
"leading",
"type",
"tag",
"and",
"length",
"header",
"as",
"a",
"newly",
"-",
"allocated",
"byte",
"array",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/BinaryField.java#L69-L74 |
164,032 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/CueList.java | CueList.getHotCueCount | public int getHotCueCount() {
if (rawMessage != null) {
return (int) ((NumberField) rawMessage.arguments.get(5)).getValue();
}
int total = 0;
for (Entry entry : entries) {
if (entry.hotCueNumber > 0) {
++total;
}
}
retur... | java | public int getHotCueCount() {
if (rawMessage != null) {
return (int) ((NumberField) rawMessage.arguments.get(5)).getValue();
}
int total = 0;
for (Entry entry : entries) {
if (entry.hotCueNumber > 0) {
++total;
}
}
retur... | [
"public",
"int",
"getHotCueCount",
"(",
")",
"{",
"if",
"(",
"rawMessage",
"!=",
"null",
")",
"{",
"return",
"(",
"int",
")",
"(",
"(",
"NumberField",
")",
"rawMessage",
".",
"arguments",
".",
"get",
"(",
"5",
")",
")",
".",
"getValue",
"(",
")",
"... | Return the number of entries in the cue list that represent hot cues.
@return the number of cue list entries that are hot cues | [
"Return",
"the",
"number",
"of",
"entries",
"in",
"the",
"cue",
"list",
"that",
"represent",
"hot",
"cues",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/CueList.java#L42-L53 |
164,033 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/CueList.java | CueList.sortEntries | private List<Entry> sortEntries(List<Entry> loadedEntries) {
Collections.sort(loadedEntries, new Comparator<Entry>() {
@Override
public int compare(Entry entry1, Entry entry2) {
int result = (int) (entry1.cuePosition - entry2.cuePosition);
if (result == 0)... | java | private List<Entry> sortEntries(List<Entry> loadedEntries) {
Collections.sort(loadedEntries, new Comparator<Entry>() {
@Override
public int compare(Entry entry1, Entry entry2) {
int result = (int) (entry1.cuePosition - entry2.cuePosition);
if (result == 0)... | [
"private",
"List",
"<",
"Entry",
">",
"sortEntries",
"(",
"List",
"<",
"Entry",
">",
"loadedEntries",
")",
"{",
"Collections",
".",
"sort",
"(",
"loadedEntries",
",",
"new",
"Comparator",
"<",
"Entry",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int"... | Sorts the entries into the order we want to present them in, which is by position, with hot cues coming after
ordinary memory points if both exist at the same position, which often happens.
@param loadedEntries the unsorted entries we have loaded from a dbserver message, metadata cache, or rekordbox
database export
@r... | [
"Sorts",
"the",
"entries",
"into",
"the",
"order",
"we",
"want",
"to",
"present",
"them",
"in",
"which",
"is",
"by",
"position",
"with",
"hot",
"cues",
"coming",
"after",
"ordinary",
"memory",
"points",
"if",
"both",
"exist",
"at",
"the",
"same",
"position... | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/CueList.java#L204-L218 |
164,034 | Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/CueList.java | CueList.addEntriesFromTag | private void addEntriesFromTag(List<Entry> entries, RekordboxAnlz.CueTag tag) {
for (RekordboxAnlz.CueEntry cueEntry : tag.cues()) { // TODO: Need to figure out how to identify deleted entries to ignore.
if (cueEntry.type() == RekordboxAnlz.CueEntryType.LOOP) {
entries.add(new Entry... | java | private void addEntriesFromTag(List<Entry> entries, RekordboxAnlz.CueTag tag) {
for (RekordboxAnlz.CueEntry cueEntry : tag.cues()) { // TODO: Need to figure out how to identify deleted entries to ignore.
if (cueEntry.type() == RekordboxAnlz.CueEntryType.LOOP) {
entries.add(new Entry... | [
"private",
"void",
"addEntriesFromTag",
"(",
"List",
"<",
"Entry",
">",
"entries",
",",
"RekordboxAnlz",
".",
"CueTag",
"tag",
")",
"{",
"for",
"(",
"RekordboxAnlz",
".",
"CueEntry",
"cueEntry",
":",
"tag",
".",
"cues",
"(",
")",
")",
"{",
"// TODO: Need t... | Helper method to add cue list entries from a parsed ANLZ cue tag
@param entries the list of entries being accumulated
@param tag the tag whose entries are to be added | [
"Helper",
"method",
"to",
"add",
"cue",
"list",
"entries",
"from",
"a",
"parsed",
"ANLZ",
"cue",
"tag"
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/CueList.java#L226-L235 |
164,035 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Processor.java | Processor.process | public final static String process(final String input, final Configuration configuration)
{
try
{
return process(new StringReader(input), configuration);
}
catch (final IOException e)
{
// This _can never_ happen
return null;
}
... | java | public final static String process(final String input, final Configuration configuration)
{
try
{
return process(new StringReader(input), configuration);
}
catch (final IOException e)
{
// This _can never_ happen
return null;
}
... | [
"public",
"final",
"static",
"String",
"process",
"(",
"final",
"String",
"input",
",",
"final",
"Configuration",
"configuration",
")",
"{",
"try",
"{",
"return",
"process",
"(",
"new",
"StringReader",
"(",
"input",
")",
",",
"configuration",
")",
";",
"}",
... | Transforms an input String into HTML using the given Configuration.
@param input
The String to process.
@param configuration
The Configuration.
@return The processed String.
@since 0.7
@see Configuration | [
"Transforms",
"an",
"input",
"String",
"into",
"HTML",
"using",
"the",
"given",
"Configuration",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Processor.java#L97-L108 |
164,036 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Processor.java | Processor.process | public final static String process(final File file, final Configuration configuration) throws IOException
{
final FileInputStream input = new FileInputStream(file);
final String ret = process(input, configuration);
input.close();
return ret;
} | java | public final static String process(final File file, final Configuration configuration) throws IOException
{
final FileInputStream input = new FileInputStream(file);
final String ret = process(input, configuration);
input.close();
return ret;
} | [
"public",
"final",
"static",
"String",
"process",
"(",
"final",
"File",
"file",
",",
"final",
"Configuration",
"configuration",
")",
"throws",
"IOException",
"{",
"final",
"FileInputStream",
"input",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"final",... | Transforms an input file into HTML using the given Configuration.
@param file
The File to process.
@param configuration
the Configuration
@return The processed String.
@throws IOException
if an IO error occurs
@since 0.7
@see Configuration | [
"Transforms",
"an",
"input",
"file",
"into",
"HTML",
"using",
"the",
"given",
"Configuration",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Processor.java#L123-L129 |
164,037 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Processor.java | Processor.process | public final static String process(final File file, final boolean safeMode) throws IOException
{
return process(file, Configuration.builder().setSafeMode(safeMode).build());
} | java | public final static String process(final File file, final boolean safeMode) throws IOException
{
return process(file, Configuration.builder().setSafeMode(safeMode).build());
} | [
"public",
"final",
"static",
"String",
"process",
"(",
"final",
"File",
"file",
",",
"final",
"boolean",
"safeMode",
")",
"throws",
"IOException",
"{",
"return",
"process",
"(",
"file",
",",
"Configuration",
".",
"builder",
"(",
")",
".",
"setSafeMode",
"(",... | Transforms an input file into HTML.
@param file
The File to process.
@param safeMode
Set to <code>true</code> to escape unsafe HTML tags.
@return The processed String.
@throws IOException
if an IO error occurs
@see Configuration#DEFAULT | [
"Transforms",
"an",
"input",
"file",
"into",
"HTML",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Processor.java#L238-L241 |
164,038 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Run.java | Run.main | public static void main(final String[] args) throws IOException
{
// This is just a _hack_ ...
BufferedReader reader = null;
if (args.length == 0)
{
System.err.println("No input file specified.");
System.exit(-1);
}
if (args.length > 1)
... | java | public static void main(final String[] args) throws IOException
{
// This is just a _hack_ ...
BufferedReader reader = null;
if (args.length == 0)
{
System.err.println("No input file specified.");
System.exit(-1);
}
if (args.length > 1)
... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"// This is just a _hack_ ...",
"BufferedReader",
"reader",
"=",
"null",
";",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"System",
... | Static main.
@param args
Program arguments.
@throws IOException
If an IO error occurred. | [
"Static",
"main",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Run.java#L75-L105 |
164,039 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/cmd/CmdLineParser.java | CmdLineParser.parse | public static List<String> parse(final String[] args, final Object... objs) throws IOException
{
final List<String> ret = Colls.list();
final List<Arg> allArgs = Colls.list();
final HashMap<String, Arg> shortArgs = new HashMap<String, Arg>();
final HashMap<String, Arg> longArgs = ne... | java | public static List<String> parse(final String[] args, final Object... objs) throws IOException
{
final List<String> ret = Colls.list();
final List<Arg> allArgs = Colls.list();
final HashMap<String, Arg> shortArgs = new HashMap<String, Arg>();
final HashMap<String, Arg> longArgs = ne... | [
"public",
"static",
"List",
"<",
"String",
">",
"parse",
"(",
"final",
"String",
"[",
"]",
"args",
",",
"final",
"Object",
"...",
"objs",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"String",
">",
"ret",
"=",
"Colls",
".",
"list",
"(",
"... | Parses command line arguments.
@param args
Array of arguments, like the ones provided by
{@code void main(String[] args)}
@param objs
One or more objects with annotated public fields.
@return A {@code List} containing all unparsed arguments (i.e. arguments
that are no switches)
@throws IOException
if a parsing error o... | [
"Parses",
"command",
"line",
"arguments",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/cmd/CmdLineParser.java#L312-L390 |
164,040 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.readUntil | public final static int readUntil(final StringBuilder out, final String in, final int start, final char end)
{
int pos = start;
while (pos < in.length())
{
final char ch = in.charAt(pos);
if (ch == '\\' && pos + 1 < in.length())
{
pos = esc... | java | public final static int readUntil(final StringBuilder out, final String in, final int start, final char end)
{
int pos = start;
while (pos < in.length())
{
final char ch = in.charAt(pos);
if (ch == '\\' && pos + 1 < in.length())
{
pos = esc... | [
"public",
"final",
"static",
"int",
"readUntil",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
",",
"final",
"char",
"end",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"while",
"(",
"pos",
"<",
"in",
... | Reads characters until the 'end' character is encountered.
@param out
The StringBuilder to write to.
@param in
The Input String.
@param start
Starting position.
@param end
End characters.
@return The new position or -1 if no 'end' char was found. | [
"Reads",
"characters",
"until",
"the",
"end",
"character",
"is",
"encountered",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L159-L181 |
164,041 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.readMdLink | public final static int readMdLink(final StringBuilder out, final String in, final int start)
{
int pos = start;
int counter = 1;
while (pos < in.length())
{
final char ch = in.charAt(pos);
if (ch == '\\' && pos + 1 < in.length())
{
... | java | public final static int readMdLink(final StringBuilder out, final String in, final int start)
{
int pos = start;
int counter = 1;
while (pos < in.length())
{
final char ch = in.charAt(pos);
if (ch == '\\' && pos + 1 < in.length())
{
... | [
"public",
"final",
"static",
"int",
"readMdLink",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"int",
"counter",
"=",
"1",
";",
"while",
"(",
"pos",
"<",
... | Reads a markdown link.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Starting position.
@return The new position or -1 if this is no valid markdown link. | [
"Reads",
"a",
"markdown",
"link",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L194-L237 |
164,042 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.readMdLinkId | public final static int readMdLinkId(final StringBuilder out, final String in, final int start)
{
int pos = start;
int counter = 1;
while (pos < in.length())
{
final char ch = in.charAt(pos);
boolean endReached = false;
switch (ch)
{
... | java | public final static int readMdLinkId(final StringBuilder out, final String in, final int start)
{
int pos = start;
int counter = 1;
while (pos < in.length())
{
final char ch = in.charAt(pos);
boolean endReached = false;
switch (ch)
{
... | [
"public",
"final",
"static",
"int",
"readMdLinkId",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"int",
"counter",
"=",
"1",
";",
"while",
"(",
"pos",
"<",
... | Reads a markdown link ID.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Starting position.
@return The new position or -1 if this is no valid markdown link ID. | [
"Reads",
"a",
"markdown",
"link",
"ID",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L250-L290 |
164,043 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.readXMLUntil | public final static int readXMLUntil(final StringBuilder out, final String in, final int start, final char... end)
{
int pos = start;
boolean inString = false;
char stringChar = 0;
while (pos < in.length())
{
final char ch = in.charAt(pos);
if (inStrin... | java | public final static int readXMLUntil(final StringBuilder out, final String in, final int start, final char... end)
{
int pos = start;
boolean inString = false;
char stringChar = 0;
while (pos < in.length())
{
final char ch = in.charAt(pos);
if (inStrin... | [
"public",
"final",
"static",
"int",
"readXMLUntil",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
",",
"final",
"char",
"...",
"end",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"boolean",
"inString",
"=... | Reads characters until any 'end' character is encountered, ignoring
escape sequences.
@param out
The StringBuilder to write to.
@param in
The Input String.
@param start
Starting position.
@param end
End characters.
@return The new position or -1 if no 'end' char was found. | [
"Reads",
"characters",
"until",
"any",
"end",
"character",
"is",
"encountered",
"ignoring",
"escape",
"sequences",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L377-L435 |
164,044 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.appendCode | public final static void appendCode(final StringBuilder out, final String in, final int start, final int end)
{
for (int i = start; i < end; i++)
{
final char c;
switch (c = in.charAt(i))
{
case '&':
out.append("&");
... | java | public final static void appendCode(final StringBuilder out, final String in, final int start, final int end)
{
for (int i = start; i < end; i++)
{
final char c;
switch (c = in.charAt(i))
{
case '&':
out.append("&");
... | [
"public",
"final",
"static",
"void",
"appendCode",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"end",
";"... | Appends the given string encoding special HTML characters.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Input String starting position.
@param end
Input String end position. | [
"Appends",
"the",
"given",
"string",
"encoding",
"special",
"HTML",
"characters",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L449-L470 |
164,045 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.appendDecEntity | public final static void appendDecEntity(final StringBuilder out, final char value)
{
out.append("&#");
out.append((int)value);
out.append(';');
} | java | public final static void appendDecEntity(final StringBuilder out, final char value)
{
out.append("&#");
out.append((int)value);
out.append(';');
} | [
"public",
"final",
"static",
"void",
"appendDecEntity",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"char",
"value",
")",
"{",
"out",
".",
"append",
"(",
"\"&#\"",
")",
";",
"out",
".",
"append",
"(",
"(",
"int",
")",
"value",
")",
";",
"out",
... | Append the given char as a decimal HTML entity.
@param out
The StringBuilder to write to.
@param value
The character. | [
"Append",
"the",
"given",
"char",
"as",
"a",
"decimal",
"HTML",
"entity",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L522-L527 |
164,046 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.codeEncode | public final static void codeEncode(final StringBuilder out, final String value, final int offset)
{
for (int i = offset; i < value.length(); i++)
{
final char c = value.charAt(i);
switch (c)
{
case '&':
out.append("&");
... | java | public final static void codeEncode(final StringBuilder out, final String value, final int offset)
{
for (int i = offset; i < value.length(); i++)
{
final char c = value.charAt(i);
switch (c)
{
case '&':
out.append("&");
... | [
"public",
"final",
"static",
"void",
"codeEncode",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"value",
",",
"final",
"int",
"offset",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"i",
"<",
"value",
".",
"length",
"(",
")",
... | Appends the given string to the given StringBuilder, replacing '&',
'<' and '>' by their respective HTML entities.
@param out
The StringBuilder to append to.
@param value
The string to append.
@param offset
The character offset into value from where to start | [
"Appends",
"the",
"given",
"string",
"to",
"the",
"given",
"StringBuilder",
"replacing",
"&",
";",
"<",
";",
"and",
">",
";",
"by",
"their",
"respective",
"HTML",
"entities",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L743-L763 |
164,047 | rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Line.java | Line.countCharsStart | private int countCharsStart(final char ch, final boolean allowSpaces)
{
int count = 0;
for (int i = 0; i < this.value.length(); i++)
{
final char c = this.value.charAt(i);
if (c == ' ' && allowSpaces)
{
continue;
}
i... | java | private int countCharsStart(final char ch, final boolean allowSpaces)
{
int count = 0;
for (int i = 0; i < this.value.length(); i++)
{
final char c = this.value.charAt(i);
if (c == ' ' && allowSpaces)
{
continue;
}
i... | [
"private",
"int",
"countCharsStart",
"(",
"final",
"char",
"ch",
",",
"final",
"boolean",
"allowSpaces",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"value",
".",
"length",
"(",
")",
";",
... | Counts the amount of 'ch' at the start of this line optionally ignoring
spaces.
@param ch
The char to count.
@param allowSpaces
Whether to allow spaces or not
@return Number of characters found.
@since 0.12 | [
"Counts",
"the",
"amount",
"of",
"ch",
"at",
"the",
"start",
"of",
"this",
"line",
"optionally",
"ignoring",
"spaces",
"."
] | 108cee6b209a362843729c032c2d982625d12d98 | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Line.java#L247-L267 |
164,048 | iwgang/SimplifySpan | library/src/main/java/cn/iwgang/simplifyspan/SimplifySpanBuild.java | SimplifySpanBuild.append | public SimplifySpanBuild append(String text) {
if (TextUtils.isEmpty(text)) return this;
mNormalSizeText.append(text);
mStringBuilder.append(text);
return this;
} | java | public SimplifySpanBuild append(String text) {
if (TextUtils.isEmpty(text)) return this;
mNormalSizeText.append(text);
mStringBuilder.append(text);
return this;
} | [
"public",
"SimplifySpanBuild",
"append",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"text",
")",
")",
"return",
"this",
";",
"mNormalSizeText",
".",
"append",
"(",
"text",
")",
";",
"mStringBuilder",
".",
"append",
"(",
... | append normal text
@param text normal text
@return SimplifySpanBuild | [
"append",
"normal",
"text"
] | 34e917cd5497215c8abc07b3d8df187949967283 | https://github.com/iwgang/SimplifySpan/blob/34e917cd5497215c8abc07b3d8df187949967283/library/src/main/java/cn/iwgang/simplifyspan/SimplifySpanBuild.java#L191-L197 |
164,049 | iwgang/SimplifySpan | library/src/main/java/cn/iwgang/simplifyspan/SimplifySpanBuild.java | SimplifySpanBuild.appendMultiClickable | public SimplifySpanBuild appendMultiClickable(SpecialClickableUnit specialClickableUnit, Object... specialUnitOrStrings) {
processMultiClickableSpecialUnit(false, specialClickableUnit, specialUnitOrStrings);
return this;
} | java | public SimplifySpanBuild appendMultiClickable(SpecialClickableUnit specialClickableUnit, Object... specialUnitOrStrings) {
processMultiClickableSpecialUnit(false, specialClickableUnit, specialUnitOrStrings);
return this;
} | [
"public",
"SimplifySpanBuild",
"appendMultiClickable",
"(",
"SpecialClickableUnit",
"specialClickableUnit",
",",
"Object",
"...",
"specialUnitOrStrings",
")",
"{",
"processMultiClickableSpecialUnit",
"(",
"false",
",",
"specialClickableUnit",
",",
"specialUnitOrStrings",
")",
... | append multi clickable SpecialUnit or String
@param specialClickableUnit SpecialClickableUnit
@param specialUnitOrStrings Unit Or String
@return | [
"append",
"multi",
"clickable",
"SpecialUnit",
"or",
"String"
] | 34e917cd5497215c8abc07b3d8df187949967283 | https://github.com/iwgang/SimplifySpan/blob/34e917cd5497215c8abc07b3d8df187949967283/library/src/main/java/cn/iwgang/simplifyspan/SimplifySpanBuild.java#L240-L243 |
164,050 | erizet/SignalA | SignalA/src/main/java/com/zsoft/signala/Hubs/HubProxy.java | HubProxy.Invoke | @Override
public void Invoke(final String method, JSONArray args,
HubInvokeCallback callback) {
if (method == null)
{
throw new IllegalArgumentException("method");
}
if (args == null)
{
throw new IllegalArgumentException("args");
}
final S... | java | @Override
public void Invoke(final String method, JSONArray args,
HubInvokeCallback callback) {
if (method == null)
{
throw new IllegalArgumentException("method");
}
if (args == null)
{
throw new IllegalArgumentException("args");
}
final S... | [
"@",
"Override",
"public",
"void",
"Invoke",
"(",
"final",
"String",
"method",
",",
"JSONArray",
"args",
",",
"HubInvokeCallback",
"callback",
")",
"{",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"method\"",... | Executes a method on the server asynchronously | [
"Executes",
"a",
"method",
"on",
"the",
"server",
"asynchronously"
] | d33bf49dbcf7249f826c5dbb3411cfe4f5d97dd4 | https://github.com/erizet/SignalA/blob/d33bf49dbcf7249f826c5dbb3411cfe4f5d97dd4/SignalA/src/main/java/com/zsoft/signala/Hubs/HubProxy.java#L34-L70 |
164,051 | Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/util/LineColorResolver.java | LineColorResolver.resolveLineAlpha | @IntRange(from = 0, to = OPAQUE)
private static int resolveLineAlpha(
@IntRange(from = 0, to = OPAQUE) final int sceneAlpha,
final float maxDistance,
final float distance) {
final float alphaPercent = 1f - distance / maxDistance;
final int alpha = (int) ((float) O... | java | @IntRange(from = 0, to = OPAQUE)
private static int resolveLineAlpha(
@IntRange(from = 0, to = OPAQUE) final int sceneAlpha,
final float maxDistance,
final float distance) {
final float alphaPercent = 1f - distance / maxDistance;
final int alpha = (int) ((float) O... | [
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"OPAQUE",
")",
"private",
"static",
"int",
"resolveLineAlpha",
"(",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"OPAQUE",
")",
"final",
"int",
"sceneAlpha",
",",
"final",
"float",
"m... | Resolves line alpha based on distance comparing to max distance.
Where alpha is close to 0 for maxDistance, and close to 1 to 0 distance.
@param distance line length
@param maxDistance max line length
@return line alpha | [
"Resolves",
"line",
"alpha",
"based",
"on",
"distance",
"comparing",
"to",
"max",
"distance",
".",
"Where",
"alpha",
"is",
"close",
"to",
"0",
"for",
"maxDistance",
"and",
"close",
"to",
"1",
"to",
"0",
"distance",
"."
] | 97ab510936692b5cf47822df78dd455f5e4b7ddf | https://github.com/Doctoror/ParticlesDrawable/blob/97ab510936692b5cf47822df78dd455f5e4b7ddf/library/src/main/java/com/doctoror/particlesdrawable/util/LineColorResolver.java#L36-L44 |
164,052 | Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java | ParticleGenerator.applyFreshParticleOnScreen | void applyFreshParticleOnScreen(
@NonNull final Scene scene,
final int position
) {
final int w = scene.getWidth();
final int h = scene.getHeight();
if (w == 0 || h == 0) {
throw new IllegalStateException(
"Cannot generate particles if ... | java | void applyFreshParticleOnScreen(
@NonNull final Scene scene,
final int position
) {
final int w = scene.getWidth();
final int h = scene.getHeight();
if (w == 0 || h == 0) {
throw new IllegalStateException(
"Cannot generate particles if ... | [
"void",
"applyFreshParticleOnScreen",
"(",
"@",
"NonNull",
"final",
"Scene",
"scene",
",",
"final",
"int",
"position",
")",
"{",
"final",
"int",
"w",
"=",
"scene",
".",
"getWidth",
"(",
")",
";",
"final",
"int",
"h",
"=",
"scene",
".",
"getHeight",
"(",
... | Set new point coordinates somewhere on screen and apply new direction
@param position the point position to apply new values to | [
"Set",
"new",
"point",
"coordinates",
"somewhere",
"on",
"screen",
"and",
"apply",
"new",
"direction"
] | 97ab510936692b5cf47822df78dd455f5e4b7ddf | https://github.com/Doctoror/ParticlesDrawable/blob/97ab510936692b5cf47822df78dd455f5e4b7ddf/library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java#L56-L83 |
164,053 | Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java | ParticleGenerator.applyFreshParticleOffScreen | void applyFreshParticleOffScreen(
@NonNull final Scene scene,
final int position) {
final int w = scene.getWidth();
final int h = scene.getHeight();
if (w == 0 || h == 0) {
throw new IllegalStateException(
"Cannot generate particles if scen... | java | void applyFreshParticleOffScreen(
@NonNull final Scene scene,
final int position) {
final int w = scene.getWidth();
final int h = scene.getHeight();
if (w == 0 || h == 0) {
throw new IllegalStateException(
"Cannot generate particles if scen... | [
"void",
"applyFreshParticleOffScreen",
"(",
"@",
"NonNull",
"final",
"Scene",
"scene",
",",
"final",
"int",
"position",
")",
"{",
"final",
"int",
"w",
"=",
"scene",
".",
"getWidth",
"(",
")",
";",
"final",
"int",
"h",
"=",
"scene",
".",
"getHeight",
"(",... | Set new particle coordinates somewhere off screen and apply new direction towards the screen
@param position the particle position to apply new values to | [
"Set",
"new",
"particle",
"coordinates",
"somewhere",
"off",
"screen",
"and",
"apply",
"new",
"direction",
"towards",
"the",
"screen"
] | 97ab510936692b5cf47822df78dd455f5e4b7ddf | https://github.com/Doctoror/ParticlesDrawable/blob/97ab510936692b5cf47822df78dd455f5e4b7ddf/library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java#L90-L167 |
164,054 | Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java | ParticleGenerator.angleDeg | private static float angleDeg(final float ax, final float ay,
final float bx, final float by) {
final double angleRad = Math.atan2(ay - by, ax - bx);
double angle = Math.toDegrees(angleRad);
if (angleRad < 0) {
angle += 360;
}
return ... | java | private static float angleDeg(final float ax, final float ay,
final float bx, final float by) {
final double angleRad = Math.atan2(ay - by, ax - bx);
double angle = Math.toDegrees(angleRad);
if (angleRad < 0) {
angle += 360;
}
return ... | [
"private",
"static",
"float",
"angleDeg",
"(",
"final",
"float",
"ax",
",",
"final",
"float",
"ay",
",",
"final",
"float",
"bx",
",",
"final",
"float",
"by",
")",
"{",
"final",
"double",
"angleRad",
"=",
"Math",
".",
"atan2",
"(",
"ay",
"-",
"by",
",... | Returns angle in degrees between two points
@param ax x of the point 1
@param ay y of the point 1
@param bx x of the point 2
@param by y of the point 2
@return angle in degrees between two points | [
"Returns",
"angle",
"in",
"degrees",
"between",
"two",
"points"
] | 97ab510936692b5cf47822df78dd455f5e4b7ddf | https://github.com/Doctoror/ParticlesDrawable/blob/97ab510936692b5cf47822df78dd455f5e4b7ddf/library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java#L178-L186 |
164,055 | Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java | ParticleGenerator.newRandomIndividualParticleRadius | private float newRandomIndividualParticleRadius(@NonNull final SceneConfiguration scene) {
return scene.getParticleRadiusMin() == scene.getParticleRadiusMax() ?
scene.getParticleRadiusMin() : scene.getParticleRadiusMin() + (random.nextInt(
(int) ((scene.getParticleRadiusMax() - s... | java | private float newRandomIndividualParticleRadius(@NonNull final SceneConfiguration scene) {
return scene.getParticleRadiusMin() == scene.getParticleRadiusMax() ?
scene.getParticleRadiusMin() : scene.getParticleRadiusMin() + (random.nextInt(
(int) ((scene.getParticleRadiusMax() - s... | [
"private",
"float",
"newRandomIndividualParticleRadius",
"(",
"@",
"NonNull",
"final",
"SceneConfiguration",
"scene",
")",
"{",
"return",
"scene",
".",
"getParticleRadiusMin",
"(",
")",
"==",
"scene",
".",
"getParticleRadiusMax",
"(",
")",
"?",
"scene",
".",
"getP... | Generates new individual particle radius based on min and max radius setting.
@return new particle radius | [
"Generates",
"new",
"individual",
"particle",
"radius",
"based",
"on",
"min",
"and",
"max",
"radius",
"setting",
"."
] | 97ab510936692b5cf47822df78dd455f5e4b7ddf | https://github.com/Doctoror/ParticlesDrawable/blob/97ab510936692b5cf47822df78dd455f5e4b7ddf/library/src/main/java/com/doctoror/particlesdrawable/engine/ParticleGenerator.java#L203-L208 |
164,056 | Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/util/DistanceResolver.java | DistanceResolver.distance | public static float distance(final float ax, final float ay,
final float bx, final float by) {
return (float) Math.sqrt(
(ax - bx) * (ax - bx) +
(ay - by) * (ay - by)
);
} | java | public static float distance(final float ax, final float ay,
final float bx, final float by) {
return (float) Math.sqrt(
(ax - bx) * (ax - bx) +
(ay - by) * (ay - by)
);
} | [
"public",
"static",
"float",
"distance",
"(",
"final",
"float",
"ax",
",",
"final",
"float",
"ay",
",",
"final",
"float",
"bx",
",",
"final",
"float",
"by",
")",
"{",
"return",
"(",
"float",
")",
"Math",
".",
"sqrt",
"(",
"(",
"ax",
"-",
"bx",
")",... | Calculates the distance between two points
@return distance between two points | [
"Calculates",
"the",
"distance",
"between",
"two",
"points"
] | 97ab510936692b5cf47822df78dd455f5e4b7ddf | https://github.com/Doctoror/ParticlesDrawable/blob/97ab510936692b5cf47822df78dd455f5e4b7ddf/library/src/main/java/com/doctoror/particlesdrawable/util/DistanceResolver.java#L28-L34 |
164,057 | ajoberstar/gradle-git | src/main/groovy/org/ajoberstar/gradle/git/auth/BasicPasswordCredentials.java | BasicPasswordCredentials.toGrgit | public Credentials toGrgit() {
if (username != null && password != null) {
return new Credentials(username, password);
} else {
return null;
}
} | java | public Credentials toGrgit() {
if (username != null && password != null) {
return new Credentials(username, password);
} else {
return null;
}
} | [
"public",
"Credentials",
"toGrgit",
"(",
")",
"{",
"if",
"(",
"username",
"!=",
"null",
"&&",
"password",
"!=",
"null",
")",
"{",
"return",
"new",
"Credentials",
"(",
"username",
",",
"password",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
... | Converts to credentials for use in Grgit.
@return {@code null} if both username and password are {@code null},
otherwise returns credentials in Grgit format. | [
"Converts",
"to",
"credentials",
"for",
"use",
"in",
"Grgit",
"."
] | 03b08b9f8dd2b2ff0ee9228906a6e9781b85ec79 | https://github.com/ajoberstar/gradle-git/blob/03b08b9f8dd2b2ff0ee9228906a6e9781b85ec79/src/main/groovy/org/ajoberstar/gradle/git/auth/BasicPasswordCredentials.java#L87-L93 |
164,058 | f2prateek/dart | dart-sample/app/src/main/java/com/f2prateek/dart/example/MainActivity.java | MainActivity.onSampleActivityCTAClick | @OnClick(R.id.navigateToSampleActivity)
public void onSampleActivityCTAClick() {
StringParcel parcel1 = new StringParcel("Andy");
StringParcel parcel2 = new StringParcel("Tony");
List<StringParcel> parcelList = new ArrayList<>();
parcelList.add(parcel1);
parcelList.add(parcel2);
SparseArray<... | java | @OnClick(R.id.navigateToSampleActivity)
public void onSampleActivityCTAClick() {
StringParcel parcel1 = new StringParcel("Andy");
StringParcel parcel2 = new StringParcel("Tony");
List<StringParcel> parcelList = new ArrayList<>();
parcelList.add(parcel1);
parcelList.add(parcel2);
SparseArray<... | [
"@",
"OnClick",
"(",
"R",
".",
"id",
".",
"navigateToSampleActivity",
")",
"public",
"void",
"onSampleActivityCTAClick",
"(",
")",
"{",
"StringParcel",
"parcel1",
"=",
"new",
"StringParcel",
"(",
"\"Andy\"",
")",
";",
"StringParcel",
"parcel2",
"=",
"new",
"St... | Launch Sample Activity residing in the same module | [
"Launch",
"Sample",
"Activity",
"residing",
"in",
"the",
"same",
"module"
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/dart-sample/app/src/main/java/com/f2prateek/dart/example/MainActivity.java#L42-L66 |
164,059 | f2prateek/dart | dart-sample/app/src/main/java/com/f2prateek/dart/example/MainActivity.java | MainActivity.onNavigationServiceCTAClick | @OnClick(R.id.navigateToModule1Service)
public void onNavigationServiceCTAClick() {
Intent intentService = HensonNavigator.gotoModule1Service(this)
.stringExtra("foo")
.build();
startService(intentService);
} | java | @OnClick(R.id.navigateToModule1Service)
public void onNavigationServiceCTAClick() {
Intent intentService = HensonNavigator.gotoModule1Service(this)
.stringExtra("foo")
.build();
startService(intentService);
} | [
"@",
"OnClick",
"(",
"R",
".",
"id",
".",
"navigateToModule1Service",
")",
"public",
"void",
"onNavigationServiceCTAClick",
"(",
")",
"{",
"Intent",
"intentService",
"=",
"HensonNavigator",
".",
"gotoModule1Service",
"(",
"this",
")",
".",
"stringExtra",
"(",
"\... | Launch Navigation Service residing in the navigation module | [
"Launch",
"Navigation",
"Service",
"residing",
"in",
"the",
"navigation",
"module"
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/dart-sample/app/src/main/java/com/f2prateek/dart/example/MainActivity.java#L96-L103 |
164,060 | f2prateek/dart | dart-common/src/main/java/dart/common/util/StringUtil.java | StringUtil.isValidFqcn | public static boolean isValidFqcn(String str) {
if (isNullOrEmpty(str)) {
return false;
}
final String[] parts = str.split("\\.");
if (parts.length < 2) {
return false;
}
for (String part : parts) {
if (!isValidJavaIdentifier(part)) {
return false;
}
}
ret... | java | public static boolean isValidFqcn(String str) {
if (isNullOrEmpty(str)) {
return false;
}
final String[] parts = str.split("\\.");
if (parts.length < 2) {
return false;
}
for (String part : parts) {
if (!isValidJavaIdentifier(part)) {
return false;
}
}
ret... | [
"public",
"static",
"boolean",
"isValidFqcn",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"str",
")",
")",
"{",
"return",
"false",
";",
"}",
"final",
"String",
"[",
"]",
"parts",
"=",
"str",
".",
"split",
"(",
"\"\\\\.\"",
")",
"... | Returns true if the string is a valid Java full qualified class name.
@param str the string to be examined
@return true if str is a valid Java Fqcn | [
"Returns",
"true",
"if",
"the",
"string",
"is",
"a",
"valid",
"Java",
"full",
"qualified",
"class",
"name",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/dart-common/src/main/java/dart/common/util/StringUtil.java#L129-L143 |
164,061 | f2prateek/dart | henson-plugin/src/main/java/dart/henson/plugin/internal/TaskManager.java | TaskManager.createHensonNavigatorGenerationTask | public TaskProvider<GenerateHensonNavigatorTask> createHensonNavigatorGenerationTask(
BaseVariant variant, String hensonNavigatorPackageName, File destinationFolder) {
TaskProvider<GenerateHensonNavigatorTask> generateHensonNavigatorTask =
project
.getTasks()
.register(
... | java | public TaskProvider<GenerateHensonNavigatorTask> createHensonNavigatorGenerationTask(
BaseVariant variant, String hensonNavigatorPackageName, File destinationFolder) {
TaskProvider<GenerateHensonNavigatorTask> generateHensonNavigatorTask =
project
.getTasks()
.register(
... | [
"public",
"TaskProvider",
"<",
"GenerateHensonNavigatorTask",
">",
"createHensonNavigatorGenerationTask",
"(",
"BaseVariant",
"variant",
",",
"String",
"hensonNavigatorPackageName",
",",
"File",
"destinationFolder",
")",
"{",
"TaskProvider",
"<",
"GenerateHensonNavigatorTask",
... | A henson navigator is a class that helps a consumer to consume the navigation api that it
declares in its dependencies. The henson navigator will wrap the intent builders. Thus, a
henson navigator, is driven by consumption of intent builders, whereas the henson classes are
driven by the production of an intent builder.... | [
"A",
"henson",
"navigator",
"is",
"a",
"class",
"that",
"helps",
"a",
"consumer",
"to",
"consume",
"the",
"navigation",
"api",
"that",
"it",
"declares",
"in",
"its",
"dependencies",
".",
"The",
"henson",
"navigator",
"will",
"wrap",
"the",
"intent",
"builder... | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson-plugin/src/main/java/dart/henson/plugin/internal/TaskManager.java#L58-L78 |
164,062 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, Bundle value) {
delegate.putBundle(key, value);
return this;
} | java | public Bundler put(String key, Bundle value) {
delegate.putBundle(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"Bundle",
"value",
")",
"{",
"delegate",
".",
"putBundle",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a Bundle value into the mapping of the underlying Bundle, replacing any existing value
for the given key. Either key or value may be null.
@param key a String, or null
@param value a Bundle object, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"Bundle",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L127-L130 |
164,063 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, String value) {
delegate.putString(key, value);
return this;
} | java | public Bundler put(String key, String value) {
delegate.putString(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"delegate",
".",
"putString",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a String value into the mapping of the underlying Bundle, replacing any existing value
for the given key. Either key or value may be null.
@param key a String, or null
@param value a String, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"String",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L166-L169 |
164,064 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, String[] value) {
delegate.putStringArray(key, value);
return this;
} | java | public Bundler put(String key, String[] value) {
delegate.putStringArray(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"String",
"[",
"]",
"value",
")",
"{",
"delegate",
".",
"putStringArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a String array value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a String array object, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"String",
"array",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L179-L182 |
164,065 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, CharSequence value) {
delegate.putCharSequence(key, value);
return this;
} | java | public Bundler put(String key, CharSequence value) {
delegate.putCharSequence(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"delegate",
".",
"putCharSequence",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"CharSequence",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L283-L286 |
164,066 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, CharSequence[] value) {
delegate.putCharSequenceArray(key, value);
return this;
} | java | public Bundler put(String key, CharSequence[] value) {
delegate.putCharSequenceArray(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"CharSequence",
"[",
"]",
"value",
")",
"{",
"delegate",
".",
"putCharSequenceArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence array value into the mapping of the underlying Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence array object, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"CharSequence",
"array",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L296-L299 |
164,067 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, Parcelable value) {
delegate.putParcelable(key, value);
return this;
} | java | public Bundler put(String key, Parcelable value) {
delegate.putParcelable(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"Parcelable",
"value",
")",
"{",
"delegate",
".",
"putParcelable",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a Parcelable value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a Parcelable object, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"Parcelable",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L348-L351 |
164,068 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, Parcelable[] value) {
delegate.putParcelableArray(key, value);
return this;
} | java | public Bundler put(String key, Parcelable[] value) {
delegate.putParcelableArray(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"Parcelable",
"[",
"]",
"value",
")",
"{",
"delegate",
".",
"putParcelableArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an array of Parcelable values into the mapping of the underlying Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an array of Parcelable objects, or null
@return this bundler instance to chain method calls | [
"Inserts",
"an",
"array",
"of",
"Parcelable",
"values",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L361-L364 |
164,069 | f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, Serializable value) {
delegate.putSerializable(key, value);
return this;
} | java | public Bundler put(String key, Serializable value) {
delegate.putSerializable(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"Serializable",
"value",
")",
"{",
"delegate",
".",
"putSerializable",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a Serializable value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a Serializable object, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"Serializable",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L426-L429 |
164,070 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java | HostName.validate | @Override
public void validate() throws HostNameException {
if(parsedHost != null) {
return;
}
if(validationException != null) {
throw validationException;
}
synchronized(this) {
if(parsedHost != null) {
return;
}
if(validationException != null) {
throw validationException;
}
try... | java | @Override
public void validate() throws HostNameException {
if(parsedHost != null) {
return;
}
if(validationException != null) {
throw validationException;
}
synchronized(this) {
if(parsedHost != null) {
return;
}
if(validationException != null) {
throw validationException;
}
try... | [
"@",
"Override",
"public",
"void",
"validate",
"(",
")",
"throws",
"HostNameException",
"{",
"if",
"(",
"parsedHost",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"validationException",
"!=",
"null",
")",
"{",
"throw",
"validationException",
";",
... | Validates that this string is a valid host name or IP address, and if not, throws an exception with a descriptive message indicating why it is not.
@throws HostNameException | [
"Validates",
"that",
"this",
"string",
"is",
"a",
"valid",
"host",
"name",
"or",
"IP",
"address",
"and",
"if",
"not",
"throws",
"an",
"exception",
"with",
"a",
"descriptive",
"message",
"indicating",
"why",
"it",
"is",
"not",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java#L227-L249 |
164,071 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java | HostName.isValid | public boolean isValid() {
if(parsedHost != null) {
return true;
}
if(validationException != null) {
return false;
}
try {
validate();
return true;
} catch(HostNameException e) {
return false;
}
} | java | public boolean isValid() {
if(parsedHost != null) {
return true;
}
if(validationException != null) {
return false;
}
try {
validate();
return true;
} catch(HostNameException e) {
return false;
}
} | [
"public",
"boolean",
"isValid",
"(",
")",
"{",
"if",
"(",
"parsedHost",
"!=",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"validationException",
"!=",
"null",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"validate",
"(",
")",
";",
... | Returns whether this represents a valid host name or address format.
@return | [
"Returns",
"whether",
"this",
"represents",
"a",
"valid",
"host",
"name",
"or",
"address",
"format",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java#L259-L272 |
164,072 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java | HostName.toNormalizedString | @Override
public String toNormalizedString() {
String result = normalizedString;
if(result == null) {
normalizedString = result = toNormalizedString(false);
}
return result;
} | java | @Override
public String toNormalizedString() {
String result = normalizedString;
if(result == null) {
normalizedString = result = toNormalizedString(false);
}
return result;
} | [
"@",
"Override",
"public",
"String",
"toNormalizedString",
"(",
")",
"{",
"String",
"result",
"=",
"normalizedString",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"normalizedString",
"=",
"result",
"=",
"toNormalizedString",
"(",
"false",
")",
";",
"}"... | Provides a normalized string which is lowercase for host strings, and which is a normalized string for addresses.
@return | [
"Provides",
"a",
"normalized",
"string",
"which",
"is",
"lowercase",
"for",
"host",
"strings",
"and",
"which",
"is",
"a",
"normalized",
"string",
"for",
"addresses",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java#L328-L335 |
164,073 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java | HostName.getNormalizedLabels | public String[] getNormalizedLabels() {
if(isValid()) {
return parsedHost.getNormalizedLabels();
}
if(host.length() == 0) {
return new String[0];
}
return new String[] {host};
} | java | public String[] getNormalizedLabels() {
if(isValid()) {
return parsedHost.getNormalizedLabels();
}
if(host.length() == 0) {
return new String[0];
}
return new String[] {host};
} | [
"public",
"String",
"[",
"]",
"getNormalizedLabels",
"(",
")",
"{",
"if",
"(",
"isValid",
"(",
")",
")",
"{",
"return",
"parsedHost",
".",
"getNormalizedLabels",
"(",
")",
";",
"}",
"if",
"(",
"host",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"... | Returns an array of normalized strings for this host name instance.
If this represents an IP address, the address segments are separated into the returned array.
If this represents a host name string, the domain name segments are separated into the returned array,
with the top-level domain name (right-most segment) as... | [
"Returns",
"an",
"array",
"of",
"normalized",
"strings",
"for",
"this",
"host",
"name",
"instance",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java#L459-L467 |
164,074 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java | HostName.matches | public boolean matches(HostName host) {
if(this == host) {
return true;
}
if(isValid()) {
if(host.isValid()) {
if(isAddressString()) {
return host.isAddressString()
&& asAddressString().equals(host.asAddressString())
&& Objects.equals(getPort(), host.getPort())
&& Objects.equal... | java | public boolean matches(HostName host) {
if(this == host) {
return true;
}
if(isValid()) {
if(host.isValid()) {
if(isAddressString()) {
return host.isAddressString()
&& asAddressString().equals(host.asAddressString())
&& Objects.equals(getPort(), host.getPort())
&& Objects.equal... | [
"public",
"boolean",
"matches",
"(",
"HostName",
"host",
")",
"{",
"if",
"(",
"this",
"==",
"host",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"isValid",
"(",
")",
")",
"{",
"if",
"(",
"host",
".",
"isValid",
"(",
")",
")",
"{",
"if",
"("... | Returns whether the given host matches this one. For hosts to match, they must represent the same addresses or have the same host names.
Hosts are not resolved when matching. Also, hosts must have the same port and service. They must have the same masks if they are host names.
Even if two hosts are invalid, they mat... | [
"Returns",
"whether",
"the",
"given",
"host",
"matches",
"this",
"one",
".",
"For",
"hosts",
"to",
"match",
"they",
"must",
"represent",
"the",
"same",
"addresses",
"or",
"have",
"the",
"same",
"host",
"names",
".",
"Hosts",
"are",
"not",
"resolved",
"when... | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java#L495-L523 |
164,075 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java | HostName.toAddress | @Override
public IPAddress toAddress() throws UnknownHostException, HostNameException {
IPAddress addr = resolvedAddress;
if(addr == null && !resolvedIsNull) {
//note that validation handles empty address resolution
validate();
synchronized(this) {
addr = resolvedAddress;
if(addr == null && !resol... | java | @Override
public IPAddress toAddress() throws UnknownHostException, HostNameException {
IPAddress addr = resolvedAddress;
if(addr == null && !resolvedIsNull) {
//note that validation handles empty address resolution
validate();
synchronized(this) {
addr = resolvedAddress;
if(addr == null && !resol... | [
"@",
"Override",
"public",
"IPAddress",
"toAddress",
"(",
")",
"throws",
"UnknownHostException",
",",
"HostNameException",
"{",
"IPAddress",
"addr",
"=",
"resolvedAddress",
";",
"if",
"(",
"addr",
"==",
"null",
"&&",
"!",
"resolvedIsNull",
")",
"{",
"//note that... | If this represents an ip address, returns that address.
If this represents a host, returns the resolved ip address of that host.
Otherwise, returns null, but only for strings that are considered valid address strings but cannot be converted to address objects.
This method will throw exceptions for invalid formats and ... | [
"If",
"this",
"represents",
"an",
"ip",
"address",
"returns",
"that",
"address",
".",
"If",
"this",
"represents",
"a",
"host",
"returns",
"the",
"resolved",
"ip",
"address",
"of",
"that",
"host",
".",
"Otherwise",
"returns",
"null",
"but",
"only",
"for",
"... | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/HostName.java#L867-L918 |
164,076 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java | MACAddressSection.iterator | protected Iterator<MACAddress> iterator(MACAddress original) {
MACAddressCreator creator = getAddressCreator();
boolean isSingle = !isMultiple();
return iterator(
isSingle ? original : null,
creator,//using a lambda for this one results in a big performance hit
isSingle ? null : segmentsIterato... | java | protected Iterator<MACAddress> iterator(MACAddress original) {
MACAddressCreator creator = getAddressCreator();
boolean isSingle = !isMultiple();
return iterator(
isSingle ? original : null,
creator,//using a lambda for this one results in a big performance hit
isSingle ? null : segmentsIterato... | [
"protected",
"Iterator",
"<",
"MACAddress",
">",
"iterator",
"(",
"MACAddress",
"original",
")",
"{",
"MACAddressCreator",
"creator",
"=",
"getAddressCreator",
"(",
")",
";",
"boolean",
"isSingle",
"=",
"!",
"isMultiple",
"(",
")",
";",
"return",
"iterator",
"... | these are the iterators used by MACAddress | [
"these",
"are",
"the",
"iterators",
"used",
"by",
"MACAddress"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java#L1204-L1212 |
164,077 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java | MACAddressSection.toHexString | @Override
public String toHexString(boolean with0xPrefix) {
String result;
if(hasNoStringCache() || (result = (with0xPrefix ? stringCache.hexStringPrefixed : stringCache.hexString)) == null) {
result = toHexString(with0xPrefix, null);
if(with0xPrefix) {
stringCache.hexStringPrefixed = result;
... | java | @Override
public String toHexString(boolean with0xPrefix) {
String result;
if(hasNoStringCache() || (result = (with0xPrefix ? stringCache.hexStringPrefixed : stringCache.hexString)) == null) {
result = toHexString(with0xPrefix, null);
if(with0xPrefix) {
stringCache.hexStringPrefixed = result;
... | [
"@",
"Override",
"public",
"String",
"toHexString",
"(",
"boolean",
"with0xPrefix",
")",
"{",
"String",
"result",
";",
"if",
"(",
"hasNoStringCache",
"(",
")",
"||",
"(",
"result",
"=",
"(",
"with0xPrefix",
"?",
"stringCache",
".",
"hexStringPrefixed",
":",
... | Writes this address as a single hexadecimal value with always the exact same number of characters, with or without a preceding 0x prefix. | [
"Writes",
"this",
"address",
"as",
"a",
"single",
"hexadecimal",
"value",
"with",
"always",
"the",
"exact",
"same",
"number",
"of",
"characters",
"with",
"or",
"without",
"a",
"preceding",
"0x",
"prefix",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java#L1323-L1335 |
164,078 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java | MACAddressSection.toCompressedString | @Override
public String toCompressedString() {
String result;
if(hasNoStringCache() || (result = getStringCache().compressedString) == null) {
getStringCache().compressedString = result = toNormalizedString(MACStringCache.compressedParams);
}
return result;
} | java | @Override
public String toCompressedString() {
String result;
if(hasNoStringCache() || (result = getStringCache().compressedString) == null) {
getStringCache().compressedString = result = toNormalizedString(MACStringCache.compressedParams);
}
return result;
} | [
"@",
"Override",
"public",
"String",
"toCompressedString",
"(",
")",
"{",
"String",
"result",
";",
"if",
"(",
"hasNoStringCache",
"(",
")",
"||",
"(",
"result",
"=",
"getStringCache",
"(",
")",
".",
"compressedString",
")",
"==",
"null",
")",
"{",
"getStri... | This produces a shorter string for the address that uses the canonical representation but not using leading zeroes.
Each address has a unique compressed string. | [
"This",
"produces",
"a",
"shorter",
"string",
"for",
"the",
"address",
"that",
"uses",
"the",
"canonical",
"representation",
"but",
"not",
"using",
"leading",
"zeroes",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java#L1382-L1389 |
164,079 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java | MACAddressSection.toDottedString | public String toDottedString() {
String result = null;
if(hasNoStringCache() || (result = getStringCache().dottedString) == null) {
AddressDivisionGrouping dottedGrouping = getDottedGrouping();
getStringCache().dottedString = result = toNormalizedString(MACStringCache.dottedParams, dottedGrouping);
}
... | java | public String toDottedString() {
String result = null;
if(hasNoStringCache() || (result = getStringCache().dottedString) == null) {
AddressDivisionGrouping dottedGrouping = getDottedGrouping();
getStringCache().dottedString = result = toNormalizedString(MACStringCache.dottedParams, dottedGrouping);
}
... | [
"public",
"String",
"toDottedString",
"(",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"hasNoStringCache",
"(",
")",
"||",
"(",
"result",
"=",
"getStringCache",
"(",
")",
".",
"dottedString",
")",
"==",
"null",
")",
"{",
"AddressDivisionGrou... | This produces the dotted hexadecimal format aaaa.bbbb.cccc | [
"This",
"produces",
"the",
"dotted",
"hexadecimal",
"format",
"aaaa",
".",
"bbbb",
".",
"cccc"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java#L1394-L1401 |
164,080 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSegment.java | IPv6AddressSegment.getSplitSegments | public <S extends AddressSegment> void getSplitSegments(S segs[], int index, AddressSegmentCreator<S> creator) {
if(!isMultiple()) {
int bitSizeSplit = IPv6Address.BITS_PER_SEGMENT >>> 1;
Integer myPrefix = getSegmentPrefixLength();
Integer highPrefixBits = getSplitSegmentPrefix(bitSizeSplit, myPrefix, 0... | java | public <S extends AddressSegment> void getSplitSegments(S segs[], int index, AddressSegmentCreator<S> creator) {
if(!isMultiple()) {
int bitSizeSplit = IPv6Address.BITS_PER_SEGMENT >>> 1;
Integer myPrefix = getSegmentPrefixLength();
Integer highPrefixBits = getSplitSegmentPrefix(bitSizeSplit, myPrefix, 0... | [
"public",
"<",
"S",
"extends",
"AddressSegment",
">",
"void",
"getSplitSegments",
"(",
"S",
"segs",
"[",
"]",
",",
"int",
"index",
",",
"AddressSegmentCreator",
"<",
"S",
">",
"creator",
")",
"{",
"if",
"(",
"!",
"isMultiple",
"(",
")",
")",
"{",
"int"... | Converts this IPv6 address segment into smaller segments,
copying them into the given array starting at the given index.
If a segment does not fit into the array because the segment index in the array is out of bounds of the array,
then it is not copied.
@param segs
@param index | [
"Converts",
"this",
"IPv6",
"address",
"segment",
"into",
"smaller",
"segments",
"copying",
"them",
"into",
"the",
"given",
"array",
"starting",
"at",
"the",
"given",
"index",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSegment.java#L302-L317 |
164,081 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java | AddressDivisionGrouping.containsPrefixBlock | @Override
public boolean containsPrefixBlock(int prefixLength) {
checkSubnet(this, prefixLength);
int divisionCount = getDivisionCount();
int prevBitCount = 0;
for(int i = 0; i < divisionCount; i++) {
AddressDivision division = getDivision(i);
int bitCount = division.getBitCount();
int totalBitCount =... | java | @Override
public boolean containsPrefixBlock(int prefixLength) {
checkSubnet(this, prefixLength);
int divisionCount = getDivisionCount();
int prevBitCount = 0;
for(int i = 0; i < divisionCount; i++) {
AddressDivision division = getDivision(i);
int bitCount = division.getBitCount();
int totalBitCount =... | [
"@",
"Override",
"public",
"boolean",
"containsPrefixBlock",
"(",
"int",
"prefixLength",
")",
"{",
"checkSubnet",
"(",
"this",
",",
"prefixLength",
")",
";",
"int",
"divisionCount",
"=",
"getDivisionCount",
"(",
")",
";",
"int",
"prevBitCount",
"=",
"0",
";",
... | Returns whether the values of this division grouping contain the prefix block for the given prefix length
@param prefixLength
@return | [
"Returns",
"whether",
"the",
"values",
"of",
"this",
"division",
"grouping",
"contain",
"the",
"prefix",
"block",
"for",
"the",
"given",
"prefix",
"length"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java#L136-L161 |
164,082 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java | AddressDivisionGrouping.normalizePrefixBoundary | protected static <S extends IPAddressSegment> void normalizePrefixBoundary(
int sectionPrefixBits,
S segments[],
int segmentBitCount,
int segmentByteCount,
BiFunction<S, Integer, S> segProducer) {
//we've already verified segment prefixes in super constructor. We simply need to check the case where th... | java | protected static <S extends IPAddressSegment> void normalizePrefixBoundary(
int sectionPrefixBits,
S segments[],
int segmentBitCount,
int segmentByteCount,
BiFunction<S, Integer, S> segProducer) {
//we've already verified segment prefixes in super constructor. We simply need to check the case where th... | [
"protected",
"static",
"<",
"S",
"extends",
"IPAddressSegment",
">",
"void",
"normalizePrefixBoundary",
"(",
"int",
"sectionPrefixBits",
",",
"S",
"segments",
"[",
"]",
",",
"int",
"segmentBitCount",
",",
"int",
"segmentByteCount",
",",
"BiFunction",
"<",
"S",
"... | In the case where the prefix sits at a segment boundary, and the prefix sequence is null - null - 0, this changes to prefix sequence of null - x - 0, where x is segment bit length.
Note: We allow both [null, null, 0] and [null, x, 0] where x is segment length. However, to avoid inconsistencies when doing segment repl... | [
"In",
"the",
"case",
"where",
"the",
"prefix",
"sits",
"at",
"a",
"segment",
"boundary",
"and",
"the",
"prefix",
"sequence",
"is",
"null",
"-",
"null",
"-",
"0",
"this",
"changes",
"to",
"prefix",
"sequence",
"of",
"null",
"-",
"x",
"-",
"0",
"where",
... | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java#L335-L350 |
164,083 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java | AddressDivisionGrouping.fastIncrement | protected static <R extends AddressSection, S extends AddressSegment> R fastIncrement(
R section,
long increment,
AddressCreator<?, R, ?, S> addrCreator,
Supplier<R> lowerProducer,
Supplier<R> upperProducer,
Integer prefixLength) {
if(increment >= 0) {
BigInteger count = section.getCount();
i... | java | protected static <R extends AddressSection, S extends AddressSegment> R fastIncrement(
R section,
long increment,
AddressCreator<?, R, ?, S> addrCreator,
Supplier<R> lowerProducer,
Supplier<R> upperProducer,
Integer prefixLength) {
if(increment >= 0) {
BigInteger count = section.getCount();
i... | [
"protected",
"static",
"<",
"R",
"extends",
"AddressSection",
",",
"S",
"extends",
"AddressSegment",
">",
"R",
"fastIncrement",
"(",
"R",
"section",
",",
"long",
"increment",
",",
"AddressCreator",
"<",
"?",
",",
"R",
",",
"?",
",",
"S",
">",
"addrCreator"... | Handles the cases in which we can use longs rather than BigInteger
@param section
@param increment
@param addrCreator
@param lowerProducer
@param upperProducer
@param prefixLength
@return | [
"Handles",
"the",
"cases",
"in",
"which",
"we",
"can",
"use",
"longs",
"rather",
"than",
"BigInteger"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivisionGrouping.java#L1090-L1129 |
164,084 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/sql/SQLStringMatcher.java | SQLStringMatcher.getSQLCondition | public StringBuilder getSQLCondition(StringBuilder builder, String columnName) {
String string = networkString.getString();
if(isEntireAddress) {
matchString(builder, columnName, string);
} else {
matchSubString(
builder,
columnName,
networkString.getTrailingSegmentSeparator(),
networkSt... | java | public StringBuilder getSQLCondition(StringBuilder builder, String columnName) {
String string = networkString.getString();
if(isEntireAddress) {
matchString(builder, columnName, string);
} else {
matchSubString(
builder,
columnName,
networkString.getTrailingSegmentSeparator(),
networkSt... | [
"public",
"StringBuilder",
"getSQLCondition",
"(",
"StringBuilder",
"builder",
",",
"String",
"columnName",
")",
"{",
"String",
"string",
"=",
"networkString",
".",
"getString",
"(",
")",
";",
"if",
"(",
"isEntireAddress",
")",
"{",
"matchString",
"(",
"builder"... | Get an SQL condition to match this address section representation
@param builder
@param columnName
@return the condition | [
"Get",
"an",
"SQL",
"condition",
"to",
"match",
"this",
"address",
"section",
"representation"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/sql/SQLStringMatcher.java#L53-L66 |
164,085 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionBase.java | AddressDivisionBase.getRadixPower | protected static BigInteger getRadixPower(BigInteger radix, int power) {
long key = (((long) radix.intValue()) << 32) | power;
BigInteger result = radixPowerMap.get(key);
if(result == null) {
if(power == 1) {
result = radix;
} else if((power & 1) == 0) {
BigInteger halfPower = getRadixPower(radix, p... | java | protected static BigInteger getRadixPower(BigInteger radix, int power) {
long key = (((long) radix.intValue()) << 32) | power;
BigInteger result = radixPowerMap.get(key);
if(result == null) {
if(power == 1) {
result = radix;
} else if((power & 1) == 0) {
BigInteger halfPower = getRadixPower(radix, p... | [
"protected",
"static",
"BigInteger",
"getRadixPower",
"(",
"BigInteger",
"radix",
",",
"int",
"power",
")",
"{",
"long",
"key",
"=",
"(",
"(",
"(",
"long",
")",
"radix",
".",
"intValue",
"(",
")",
")",
"<<",
"32",
")",
"|",
"power",
";",
"BigInteger",
... | Caches the results of radix to the given power.
@param radix
@param power
@return | [
"Caches",
"the",
"results",
"of",
"radix",
"to",
"the",
"given",
"power",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionBase.java#L351-L367 |
164,086 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java | AddressDivisionGroupingBase.getBytesInternal | protected byte[] getBytesInternal() {
byte cached[];
if(hasNoValueCache() || (cached = valueCache.lowerBytes) == null) {
valueCache.lowerBytes = cached = getBytesImpl(true);
}
return cached;
} | java | protected byte[] getBytesInternal() {
byte cached[];
if(hasNoValueCache() || (cached = valueCache.lowerBytes) == null) {
valueCache.lowerBytes = cached = getBytesImpl(true);
}
return cached;
} | [
"protected",
"byte",
"[",
"]",
"getBytesInternal",
"(",
")",
"{",
"byte",
"cached",
"[",
"]",
";",
"if",
"(",
"hasNoValueCache",
"(",
")",
"||",
"(",
"cached",
"=",
"valueCache",
".",
"lowerBytes",
")",
"==",
"null",
")",
"{",
"valueCache",
".",
"lower... | gets the bytes, sharing the cached array and does not clone it | [
"gets",
"the",
"bytes",
"sharing",
"the",
"cached",
"array",
"and",
"does",
"not",
"clone",
"it"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java#L136-L142 |
164,087 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java | AddressDivisionGroupingBase.getUpperBytesInternal | protected byte[] getUpperBytesInternal() {
byte cached[];
if(hasNoValueCache()) {
ValueCache cache = valueCache;
cache.upperBytes = cached = getBytesImpl(false);
if(!isMultiple()) {
cache.lowerBytes = cached;
}
} else {
ValueCache cache = valueCache;
if((cached = cache.upperBytes) == null) {... | java | protected byte[] getUpperBytesInternal() {
byte cached[];
if(hasNoValueCache()) {
ValueCache cache = valueCache;
cache.upperBytes = cached = getBytesImpl(false);
if(!isMultiple()) {
cache.lowerBytes = cached;
}
} else {
ValueCache cache = valueCache;
if((cached = cache.upperBytes) == null) {... | [
"protected",
"byte",
"[",
"]",
"getUpperBytesInternal",
"(",
")",
"{",
"byte",
"cached",
"[",
"]",
";",
"if",
"(",
"hasNoValueCache",
"(",
")",
")",
"{",
"ValueCache",
"cache",
"=",
"valueCache",
";",
"cache",
".",
"upperBytes",
"=",
"cached",
"=",
"getB... | Gets the bytes for the highest address in the range represented by this address.
@return | [
"Gets",
"the",
"bytes",
"for",
"the",
"highest",
"address",
"in",
"the",
"range",
"represented",
"by",
"this",
"address",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java#L203-L226 |
164,088 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java | AddressDivisionGroupingBase.getMinPrefixLengthForBlock | @Override
public int getMinPrefixLengthForBlock() {
int count = getDivisionCount();
int totalPrefix = getBitCount();
for(int i = count - 1; i >= 0 ; i--) {
AddressDivisionBase div = getDivision(i);
int segBitCount = div.getBitCount();
int segPrefix = div.getMinPrefixLengthForBlock();
if(segPrefix == ... | java | @Override
public int getMinPrefixLengthForBlock() {
int count = getDivisionCount();
int totalPrefix = getBitCount();
for(int i = count - 1; i >= 0 ; i--) {
AddressDivisionBase div = getDivision(i);
int segBitCount = div.getBitCount();
int segPrefix = div.getMinPrefixLengthForBlock();
if(segPrefix == ... | [
"@",
"Override",
"public",
"int",
"getMinPrefixLengthForBlock",
"(",
")",
"{",
"int",
"count",
"=",
"getDivisionCount",
"(",
")",
";",
"int",
"totalPrefix",
"=",
"getBitCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"count",
"-",
"1",
";",
"i",
">... | Returns the smallest prefix length possible such that this address division grouping includes the block of addresses for that prefix.
@return the prefix length | [
"Returns",
"the",
"smallest",
"prefix",
"length",
"possible",
"such",
"that",
"this",
"address",
"division",
"grouping",
"includes",
"the",
"block",
"of",
"addresses",
"for",
"that",
"prefix",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java#L347-L366 |
164,089 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java | AddressDivisionGroupingBase.getPrefixLengthForSingleBlock | @Override
public Integer getPrefixLengthForSingleBlock() {
int count = getDivisionCount();
int totalPrefix = 0;
for(int i = 0; i < count; i++) {
AddressDivisionBase div = getDivision(i);
Integer divPrefix = div.getPrefixLengthForSingleBlock();
if(divPrefix == null) {
return null;
}
totalPrefix... | java | @Override
public Integer getPrefixLengthForSingleBlock() {
int count = getDivisionCount();
int totalPrefix = 0;
for(int i = 0; i < count; i++) {
AddressDivisionBase div = getDivision(i);
Integer divPrefix = div.getPrefixLengthForSingleBlock();
if(divPrefix == null) {
return null;
}
totalPrefix... | [
"@",
"Override",
"public",
"Integer",
"getPrefixLengthForSingleBlock",
"(",
")",
"{",
"int",
"count",
"=",
"getDivisionCount",
"(",
")",
";",
"int",
"totalPrefix",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",... | Returns a prefix length for which the range of this segment grouping matches the the block of addresses for that prefix.
If no such prefix exists, returns null
If this segment grouping represents a single value, returns the bit length
@return the prefix length or null | [
"Returns",
"a",
"prefix",
"length",
"for",
"which",
"the",
"range",
"of",
"this",
"segment",
"grouping",
"matches",
"the",
"the",
"block",
"of",
"addresses",
"for",
"that",
"prefix",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java#L377-L399 |
164,090 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java | AddressDivisionGroupingBase.getCount | @Override
public BigInteger getCount() {
BigInteger cached = cachedCount;
if(cached == null) {
cachedCount = cached = getCountImpl();
}
return cached;
} | java | @Override
public BigInteger getCount() {
BigInteger cached = cachedCount;
if(cached == null) {
cachedCount = cached = getCountImpl();
}
return cached;
} | [
"@",
"Override",
"public",
"BigInteger",
"getCount",
"(",
")",
"{",
"BigInteger",
"cached",
"=",
"cachedCount",
";",
"if",
"(",
"cached",
"==",
"null",
")",
"{",
"cachedCount",
"=",
"cached",
"=",
"getCountImpl",
"(",
")",
";",
"}",
"return",
"cached",
"... | gets the count of addresses that this address division grouping may represent
If this address division grouping is not a subnet block of multiple addresses or has no range of values, then there is only one such address.
@return | [
"gets",
"the",
"count",
"of",
"addresses",
"that",
"this",
"address",
"division",
"grouping",
"may",
"represent"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionGroupingBase.java#L442-L449 |
164,091 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java | Validator.validateZone | public static int validateZone(CharSequence zone) {
for(int i = 0; i < zone.length(); i++) {
char c = zone.charAt(i);
if (c == IPAddress.PREFIX_LEN_SEPARATOR) {
return i;
}
if (c == IPv6Address.SEGMENT_SEPARATOR) {
return i;
}
}
return -1;
} | java | public static int validateZone(CharSequence zone) {
for(int i = 0; i < zone.length(); i++) {
char c = zone.charAt(i);
if (c == IPAddress.PREFIX_LEN_SEPARATOR) {
return i;
}
if (c == IPv6Address.SEGMENT_SEPARATOR) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"validateZone",
"(",
"CharSequence",
"zone",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"zone",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"char",
"c",
"=",
"zone",
".",
"charAt",
"(",
"i",
")"... | Returns the index of the first invalid character of the zone, or -1 if the zone is valid
@param sequence
@return | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"invalid",
"character",
"of",
"the",
"zone",
"or",
"-",
"1",
"if",
"the",
"zone",
"is",
"valid"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java#L1988-L1999 |
164,092 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java | Validator.switchValue8 | private static long switchValue8(long currentHexValue, int digitCount) {
long result = 0x7 & currentHexValue;
int shift = 0;
while(--digitCount > 0) {
shift += 3;
currentHexValue >>>= 4;
result |= (0x7 & currentHexValue) << shift;
}
return result;
} | java | private static long switchValue8(long currentHexValue, int digitCount) {
long result = 0x7 & currentHexValue;
int shift = 0;
while(--digitCount > 0) {
shift += 3;
currentHexValue >>>= 4;
result |= (0x7 & currentHexValue) << shift;
}
return result;
} | [
"private",
"static",
"long",
"switchValue8",
"(",
"long",
"currentHexValue",
",",
"int",
"digitCount",
")",
"{",
"long",
"result",
"=",
"0x7",
"&",
"currentHexValue",
";",
"int",
"shift",
"=",
"0",
";",
"while",
"(",
"--",
"digitCount",
">",
"0",
")",
"{... | The digits were stored as a hex value, thix switches them to an octal value.
@param currentHexValue
@param digitCount
@return | [
"The",
"digits",
"were",
"stored",
"as",
"a",
"hex",
"value",
"thix",
"switches",
"them",
"to",
"an",
"octal",
"value",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java#L2312-L2321 |
164,093 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java | Validator.validateHostImpl | static ParsedHost validateHostImpl(HostName fromHost) throws HostNameException {
final String str = fromHost.toString();
HostNameParameters validationOptions = fromHost.getValidationOptions();
return validateHost(fromHost, str, validationOptions);
} | java | static ParsedHost validateHostImpl(HostName fromHost) throws HostNameException {
final String str = fromHost.toString();
HostNameParameters validationOptions = fromHost.getValidationOptions();
return validateHost(fromHost, str, validationOptions);
} | [
"static",
"ParsedHost",
"validateHostImpl",
"(",
"HostName",
"fromHost",
")",
"throws",
"HostNameException",
"{",
"final",
"String",
"str",
"=",
"fromHost",
".",
"toString",
"(",
")",
";",
"HostNameParameters",
"validationOptions",
"=",
"fromHost",
".",
"getValidati... | So we will follow rfc 1035 and in addition allow the underscore. | [
"So",
"we",
"will",
"follow",
"rfc",
"1035",
"and",
"in",
"addition",
"allow",
"the",
"underscore",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java#L2426-L2430 |
164,094 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java | Validator.convertReverseDNSIPv4 | private static CharSequence convertReverseDNSIPv4(String str, int suffixStartIndex) throws AddressStringException {
StringBuilder builder = new StringBuilder(suffixStartIndex);
int segCount = 0;
int j = suffixStartIndex;
for(int i = suffixStartIndex - 1; i > 0; i--) {
char c1 = str.charAt(i);
if(c1 == IPv... | java | private static CharSequence convertReverseDNSIPv4(String str, int suffixStartIndex) throws AddressStringException {
StringBuilder builder = new StringBuilder(suffixStartIndex);
int segCount = 0;
int j = suffixStartIndex;
for(int i = suffixStartIndex - 1; i > 0; i--) {
char c1 = str.charAt(i);
if(c1 == IPv... | [
"private",
"static",
"CharSequence",
"convertReverseDNSIPv4",
"(",
"String",
"str",
",",
"int",
"suffixStartIndex",
")",
"throws",
"AddressStringException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"suffixStartIndex",
")",
";",
"int",
"segCou... | 123.2.3.4 is 4.3.2.123.in-addr.arpa. | [
"123",
".",
"2",
".",
"3",
".",
"4",
"is",
"4",
".",
"3",
".",
"2",
".",
"123",
".",
"in",
"-",
"addr",
".",
"arpa",
"."
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/validate/Validator.java#L3062-L3087 |
164,095 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java | AddressDivision.isPrefixBlock | protected boolean isPrefixBlock(long divisionValue, long upperValue, int divisionPrefixLen) {
if(divisionPrefixLen == 0) {
return divisionValue == 0 && upperValue == getMaxValue();
}
long ones = ~0L;
long divisionBitMask = ~(ones << getBitCount());
long divisionPrefixMask = ones << (getBitCount() - divisio... | java | protected boolean isPrefixBlock(long divisionValue, long upperValue, int divisionPrefixLen) {
if(divisionPrefixLen == 0) {
return divisionValue == 0 && upperValue == getMaxValue();
}
long ones = ~0L;
long divisionBitMask = ~(ones << getBitCount());
long divisionPrefixMask = ones << (getBitCount() - divisio... | [
"protected",
"boolean",
"isPrefixBlock",
"(",
"long",
"divisionValue",
",",
"long",
"upperValue",
",",
"int",
"divisionPrefixLen",
")",
"{",
"if",
"(",
"divisionPrefixLen",
"==",
"0",
")",
"{",
"return",
"divisionValue",
"==",
"0",
"&&",
"upperValue",
"==",
"g... | Returns whether the division range includes the block of values for its prefix length | [
"Returns",
"whether",
"the",
"division",
"range",
"includes",
"the",
"block",
"of",
"values",
"for",
"its",
"prefix",
"length"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java#L196-L209 |
164,096 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java | AddressDivision.matchesWithMask | public boolean matchesWithMask(long lowerValue, long upperValue, long mask) {
if(lowerValue == upperValue) {
return matchesWithMask(lowerValue, mask);
}
if(!isMultiple()) {
//we know lowerValue and upperValue are not the same, so impossible to match those two values with a single value
return false;
}
... | java | public boolean matchesWithMask(long lowerValue, long upperValue, long mask) {
if(lowerValue == upperValue) {
return matchesWithMask(lowerValue, mask);
}
if(!isMultiple()) {
//we know lowerValue and upperValue are not the same, so impossible to match those two values with a single value
return false;
}
... | [
"public",
"boolean",
"matchesWithMask",
"(",
"long",
"lowerValue",
",",
"long",
"upperValue",
",",
"long",
"mask",
")",
"{",
"if",
"(",
"lowerValue",
"==",
"upperValue",
")",
"{",
"return",
"matchesWithMask",
"(",
"lowerValue",
",",
"mask",
")",
";",
"}",
... | returns whether masking with the given mask results in a valid contiguous range for this segment,
and if it does, if it matches the range obtained when masking the given values with the same mask.
@param lowerValue
@param upperValue
@param mask
@return | [
"returns",
"whether",
"masking",
"with",
"the",
"given",
"mask",
"results",
"in",
"a",
"valid",
"contiguous",
"range",
"for",
"this",
"segment",
"and",
"if",
"it",
"does",
"if",
"it",
"matches",
"the",
"range",
"obtained",
"when",
"masking",
"the",
"given",
... | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java#L266-L280 |
164,097 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java | AddressDivision.isMaskCompatibleWithRange | protected static boolean isMaskCompatibleWithRange(long value, long upperValue, long maskValue, long maxValue) {
if(value == upperValue || maskValue == maxValue || maskValue == 0) {
return true;
}
//algorithm:
//here we find the highest bit that is part of the range, highestDifferingBitInRange (ie changes f... | java | protected static boolean isMaskCompatibleWithRange(long value, long upperValue, long maskValue, long maxValue) {
if(value == upperValue || maskValue == maxValue || maskValue == 0) {
return true;
}
//algorithm:
//here we find the highest bit that is part of the range, highestDifferingBitInRange (ie changes f... | [
"protected",
"static",
"boolean",
"isMaskCompatibleWithRange",
"(",
"long",
"value",
",",
"long",
"upperValue",
",",
"long",
"maskValue",
",",
"long",
"maxValue",
")",
"{",
"if",
"(",
"value",
"==",
"upperValue",
"||",
"maskValue",
"==",
"maxValue",
"||",
"mas... | when divisionPrefixLen is null, isAutoSubnets has no effect | [
"when",
"divisionPrefixLen",
"is",
"null",
"isAutoSubnets",
"has",
"no",
"effect"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/standard/AddressDivision.java#L309-L355 |
164,098 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java | IPv6AddressSection.isEUI64 | public boolean isEUI64(boolean partial) {
int segmentCount = getSegmentCount();
int endIndex = addressSegmentIndex + segmentCount;
if(addressSegmentIndex <= 5) {
if(endIndex > 6) {
int index3 = 5 - addressSegmentIndex;
IPv6AddressSegment seg3 = getSegment(index3);
IPv6AddressSegment seg4 = getSegme... | java | public boolean isEUI64(boolean partial) {
int segmentCount = getSegmentCount();
int endIndex = addressSegmentIndex + segmentCount;
if(addressSegmentIndex <= 5) {
if(endIndex > 6) {
int index3 = 5 - addressSegmentIndex;
IPv6AddressSegment seg3 = getSegment(index3);
IPv6AddressSegment seg4 = getSegme... | [
"public",
"boolean",
"isEUI64",
"(",
"boolean",
"partial",
")",
"{",
"int",
"segmentCount",
"=",
"getSegmentCount",
"(",
")",
";",
"int",
"endIndex",
"=",
"addressSegmentIndex",
"+",
"segmentCount",
";",
"if",
"(",
"addressSegmentIndex",
"<=",
"5",
")",
"{",
... | Whether this section is consistent with an EUI64 section,
which means it came from an extended 8 byte address,
and the corresponding segments in the middle match 0xff and 0xfe
@param partial whether missing segments are considered a match
@return | [
"Whether",
"this",
"section",
"is",
"consistent",
"with",
"an",
"EUI64",
"section",
"which",
"means",
"it",
"came",
"from",
"an",
"extended",
"8",
"byte",
"address",
"and",
"the",
"corresponding",
"segments",
"in",
"the",
"middle",
"match",
"0xff",
"and",
"0... | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java#L1133-L1151 |
164,099 | seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java | IPv6AddressSection.toEUI | public MACAddressSection toEUI(boolean extended) {
MACAddressSegment[] segs = toEUISegments(extended);
if(segs == null) {
return null;
}
MACAddressCreator creator = getMACNetwork().getAddressCreator();
return createSectionInternal(creator, segs, Math.max(0, addressSegmentIndex - 4) << 1, extended);
} | java | public MACAddressSection toEUI(boolean extended) {
MACAddressSegment[] segs = toEUISegments(extended);
if(segs == null) {
return null;
}
MACAddressCreator creator = getMACNetwork().getAddressCreator();
return createSectionInternal(creator, segs, Math.max(0, addressSegmentIndex - 4) << 1, extended);
} | [
"public",
"MACAddressSection",
"toEUI",
"(",
"boolean",
"extended",
")",
"{",
"MACAddressSegment",
"[",
"]",
"segs",
"=",
"toEUISegments",
"(",
"extended",
")",
";",
"if",
"(",
"segs",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"MACAddressCreator",
... | Returns the corresponding mac section, or null if this address section does not correspond to a mac section.
If this address section has a prefix length it is ignored.
@param extended
@return | [
"Returns",
"the",
"corresponding",
"mac",
"section",
"or",
"null",
"if",
"this",
"address",
"section",
"does",
"not",
"correspond",
"to",
"a",
"mac",
"section",
".",
"If",
"this",
"address",
"section",
"has",
"a",
"prefix",
"length",
"it",
"is",
"ignored",
... | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java#L1160-L1167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.