id
stringlengths
7
14
text
stringlengths
1
106k
3424353_1
public static <K extends Number, V extends Number> double interpolate( SortedMap<K, V> values, K target) { return interpolate(values, target, EOutOfRangeStrategy.INTERPOLATE); }
3424353_2
public static <K extends Number, V extends Number> double interpolate( SortedMap<K, V> values, K target) { return interpolate(values, target, EOutOfRangeStrategy.INTERPOLATE); }
3424353_3
public static <K extends Number, V extends Number> double interpolate( SortedMap<K, V> values, K target) { return interpolate(values, target, EOutOfRangeStrategy.INTERPOLATE); }
3424353_4
public static <K extends Number, V extends Number> double interpolate( SortedMap<K, V> values, K target) { return interpolate(values, target, EOutOfRangeStrategy.INTERPOLATE); }
3424353_5
public static double interpolatePair(double fromValue, double toValue, double ratio) { return ratio * (toValue - fromValue) + fromValue; }
3424353_6
public static String getTimeAsIso8601String(Date date) { return getTimeAsIso8601String(date, TimeZone.getDefault()); }
3424353_7
public static Date getIso8601StringAsTime(String value) throws ParseException { return getIso8601StringAsTime(value, TimeZone.getDefault()); }
3424353_8
public static String getAgencyIdFromEntityId(String entityId) throws InvalidArgumentServiceException { int index = entityId.indexOf('_'); if (index == -1) throw new InvalidArgumentServiceException("entityId", "badEntityId"); return entityId.substring(0, index); }
3424353_9
public Object invoke(FederatedServiceCollection collection, Method method, Object[] args) throws ServiceAreaServiceException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { double lat1 = arg(args, _lat1ArgumentIndex); double lon1 = arg(args, _lon1ArgumentIndex); double lat2 = ar...
3425475_0
public void resetCheckStatusTask(ClientSubscriptionChannel channel, int checkStatusInterval) { synchronized (channel) { channel.setCheckStatusInterval(checkStatusInterval); _log.debug("resetting check status task: channel={} interval={}", channel.getAddress(), checkStatusInterval); ScheduledFu...
3425475_1
public void resetCheckStatusTask(ClientSubscriptionChannel channel, int checkStatusInterval) { synchronized (channel) { channel.setCheckStatusInterval(checkStatusInterval); _log.debug("resetting check status task: channel={} interval={}", channel.getAddress(), checkStatusInterval); ScheduledFu...
3425475_2
public void resetHeartbeat(ClientSubscriptionChannel channel, int heartbeatInterval) { synchronized (channel) { channel.setHeartbeatInterval(heartbeatInterval); ScheduledFuture<?> heartbeatTask = channel.getHeartbeatTask(); if (heartbeatTask != null) { heartbeatTask.cancel(true); channel.s...
3425475_3
public void resetHeartbeat(ClientSubscriptionChannel channel, int heartbeatInterval) { synchronized (channel) { channel.setHeartbeatInterval(heartbeatInterval); ScheduledFuture<?> heartbeatTask = channel.getHeartbeatTask(); if (heartbeatTask != null) { heartbeatTask.cancel(true); channel.s...
3425475_4
public void resetHeartbeat(ClientSubscriptionChannel channel, int heartbeatInterval) { synchronized (channel) { channel.setHeartbeatInterval(heartbeatInterval); ScheduledFuture<?> heartbeatTask = channel.getHeartbeatTask(); if (heartbeatTask != null) { heartbeatTask.cancel(true); channel.s...
3425475_5
public void clearPendingSubscription(SiriClientRequest request, SubscriptionRequest subscriptionRequest) { _log.info("clear pending subscription: {}", request); _initiateSubscriptionsManager.clearPendingSubscription(request, subscriptionRequest); }
3425475_6
public SiriChannelInfo getChannelInfoForServiceDelivery( ServiceDelivery serviceDelivery) { SiriChannelInfo channelInfo = new SiriChannelInfo(); Set<ClientSubscriptionChannel> channels = new HashSet<ClientSubscriptionChannel>(); Set<SiriClientRequest> requests = new HashSet<SiriClientRequest>(); /** * Fi...
3425475_7
ESiriModuleType getModuleTypeForSubscriptionId(SubscriptionId subId) { ClientSubscriptionInstance instance = _activeSubscriptions.get(subId); if (instance == null) return null; return instance.getModuleType(); }
3425475_8
void handleChannelDisconnectAndReconnect(ClientSubscriptionChannel channel) { _log.info("channel disconnect: {}", channel.getAddress()); Set<SubscriptionId> channelSubscriptionIds = new HashSet<SubscriptionId>( channel.getSubscriptions()); List<ClientSubscriptionInstance> instances = new ArrayList<ClientSub...
3425475_9
public void handleCheckStatusNotification( CheckStatusResponseStructure response) { /** * Pass the response on to the CheckStatus manager */ _checkStatusManager.handleCheckStatusResponse(response); }
3429525_0
@Override public Object getDDRRecords(@Name("accountId") String accountId, @Name("adapterTypes") @Optional Collection<AdapterType> adapterTypes, @Name("adapterIds") @Optional Collection<String> adapterIds, @Name("fromAddress") @Optional String fromAddress, @Name("toAddress") @Optional String toAddress, @Nam...
3429525_1
@Override public Object getDDRRecordsRecursively(@Name("accountId") String accountId, @Name("adapterTypes") @Optional Collection<AdapterType> adapterTypes, @Name("adapterIds") @Optional Collection<String> adapterIds, @Name("fromAddress") @Optional String fromAddress, @Name("toAddress") @Optional String toAd...
3429525_2
@Override public Object getDDRRecords(@Name("accountId") String accountId, @Name("adapterTypes") @Optional Collection<AdapterType> adapterTypes, @Name("adapterIds") @Optional Collection<String> adapterIds, @Name("fromAddress") @Optional String fromAddress, @Name("toAddress") @Optional String toAddress, @Nam...
3429525_3
public void generateDefaultDDRTypes() { //check if all DDR categories are created on bootstrapping this agent for ( DDRTypeCategory ddrCategory : DDRTypeCategory.values() ) { if ( !ddrCategory.equals( DDRTypeCategory.OTHER ) ) //ignore other { try { DD...
3429525_4
public Object updateAdapter(@Name("accoutId") String accountId, @Name("adapterId") String adapterId, @Name("adapter") Adapter adapter) throws Exception { RestResponse adapterResponse = getAdapter(accountId, adapterId); AdapterConfig config = null; if(adapterResponse.getCode() == ...
3429525_5
public void addAccount(@Name("adapterId") String adapterId, @Name("accountId") String accountId) throws Exception { AdapterConfig config = AdapterConfig.getAdapterConfig(adapterId); if (config == null) throw new Exception("No adapter with this id"); config.addAccount(accountId); config.update();...
3429525_6
public static Question fromJSON(String json) { Question question = null; if (json != null && !json.isEmpty()) { try { question = om.readValue(json, Question.class); } catch (Exception e) { log.severe(e.toString()); } } return question; }
3429525_7
public static ArrayList<AdapterConfig> findAdapterByOwner(String accountId, String adapterType, String address) { TwigCompatibleMongoDatastore datastore = new TwigCompatibleMongoDatastore(); RootFindCommand<AdapterConfig> cmd = datastore.find().type(AdapterConfig.class); if (adapterType != null) cmd...
3429525_8
public String getAnswerUrl() { return "http://"+Settings.HOST+"/dialoghandler/rest/strowger/answer"; }
3429525_9
protected String renderOpenQuestion(Question question, ArrayList<String> prompts, String sessionKey) { TwiMLResponse twiml = new TwiMLResponse(); String typeProperty = question.getMediaPropertyValue(MediumType.BROADSOFT, MediaPropertyKey.TYPE); if (typeProperty != null && typeProperty.equalsIgnoreCase("audi...
3430789_0
@Override public Set<NodeId> getAvailableNodes(NodeType type) { Set<NodeId> result = Sets.newHashSet(); ZNode typeNode = rootNode.child(CoordinationUtil.nodeNameOf(type)); for (ZNode node : typeNode.children()) { if (node.hasChild(CoordinationUtil.AVAILABLE_NODE_NAME)) { result.add(NodeI...
3430789_1
@Override public Set<NodeId> getAvailableNodes(NodeType type) { Set<NodeId> result = Sets.newHashSet(); ZNode typeNode = rootNode.child(CoordinationUtil.nodeNameOf(type)); for (ZNode node : typeNode.children()) { if (node.hasChild(CoordinationUtil.AVAILABLE_NODE_NAME)) { result.add(NodeI...
3430789_2
@Override public boolean canExecuteCommands(NodeId nodeId, Set<Qualifier<?>> qualifiers) { ZNode typeNode = rootNode.child(CoordinationUtil.nodeNameOf(nodeId.getType())); String identifier = nodeId.getIdentifier(); if (!typeNode.hasChild(identifier)) { throw new CoordinatorException("Node with id " ...
3430789_3
@Override public <C extends Command<R>, R extends Serializable> void run(final C command, final NodeCommandExecutionListener<C> listener, final AsyncCallback<R> callback) { ZNode commandNode = rootNode.child(nodeId.getType().name().toLowerCase()).child(nodeId.getIdentifier()).child(command.getClass().getName()); ...
3430789_4
public static <T> CircularSupplier<T> create(Iterable<T> iterable) { return new CircularSupplier<T>(ImmutableList.copyOf(iterable)); }
3430789_5
public static <T> CircularSupplier<T> create(Iterable<T> iterable) { return new CircularSupplier<T>(ImmutableList.copyOf(iterable)); }
3430789_6
@Override public Iterator<Pair<Q, E>> provide() { final CircularSupplier<Q> querySupplier = CircularSupplier.create(queryProvider); final CircularSupplier<E> endpointSupplier = CircularSupplier.create(endpointProvider); return new Iterator<Pair<Q, E>>() { @Override public boolean hasNext() {...
3430789_7
@Override public Iterator<Pair<Q, E>> provide() { final CircularSupplier<Q> querySupplier = CircularSupplier.create(queryProvider); final CircularSupplier<E> endpointSupplier = CircularSupplier.create(endpointProvider); return new Iterator<Pair<Q, E>>() { @Override public boolean hasNext() {...
3430789_8
@Override public Iterator<Pair<Q, E>> provide() { final CircularSupplier<Q> querySupplier = CircularSupplier.create(queryProvider); final CircularSupplier<E> endpointSupplier = CircularSupplier.create(endpointProvider); return new Iterator<Pair<Q, E>>() { @Override public boolean hasNext() {...
3430789_9
@Override public Iterator<Pair<Q, E>> provide() { final CircularSupplier<Q> querySupplier = CircularSupplier.create(queryProvider); final CircularSupplier<E> endpointSupplier = CircularSupplier.create(endpointProvider); return new Iterator<Pair<Q, E>>() { @Override public boolean hasNext() {...
3432124_0
protected final void retrieveForeignData() { LOGGER.trace("begin {}.retrieveForeignData()", getClass() .getSimpleName()); for (final XBorder border : _borders) { final Map<XId, Map<XAddress, Object>> allData = border .getData(this); //FIXME: what if allData is nu...
3432124_1
@Override lic final void removeBorder( final XBorder border) { LOGGER.trace("begin {}.removeBorder({})", getClass().getSimpleName(), border); validateArg("border", border, isNotNull()); _borders.remove(border); LOGGER.trace("end {}.removeBorder()", getClass().getSimpleName()); }
3432124_2
@Override lic final void update( final XTime<StandardTimePhase> time) { LOGGER.trace("begin {}.prepareBeforeHook({})", getClass() .getSimpleName(), time); validateArg("time", time, isNotNull()); switch (time.getPhase()) { case PREPARE: prepareBeforeHook(); ...
3432124_3
@Override lic final XTime<F> increment() { LOGGER.trace("begin {}.increment()", getClass().getSimpleName()); _timeLock.lock(); try { final F nextPhase = _allPhases.get( // (_allPhases.indexOf(_time.getPhase()) + 1) % _allPhases.size()); final long tick = _time.getTick() ...
3432124_4
@Override lic final XTime<F> increment() { LOGGER.trace("begin {}.increment()", getClass().getSimpleName()); _timeLock.lock(); try { final F nextPhase = _allPhases.get( // (_allPhases.indexOf(_time.getPhase()) + 1) % _allPhases.size()); final long tick = _time.getTick() ...
3432124_5
@Override lic final int compareTo( final XClock<F> other) { LOGGER.trace("begin {}.compareTo({})", new Object[] { getClass().getSimpleName(), other }); _timeLock.lock(); try { final int rval; if (other == null) { throw new NullPointerException("can...
3432124_6
@Override lic final int compareTo( final XClock<F> other) { LOGGER.trace("begin {}.compareTo({})", new Object[] { getClass().getSimpleName(), other }); _timeLock.lock(); try { final int rval; if (other == null) { throw new NullPointerException("can...
3432124_7
@Override lic final int compareTo( final XClock<F> other) { LOGGER.trace("begin {}.compareTo({})", new Object[] { getClass().getSimpleName(), other }); _timeLock.lock(); try { final int rval; if (other == null) { throw new NullPointerException("can...
3432124_8
@Override lic final int compareTo( final XClock<F> other) { LOGGER.trace("begin {}.compareTo({})", new Object[] { getClass().getSimpleName(), other }); _timeLock.lock(); try { final int rval; if (other == null) { throw new NullPointerException("can...
3432124_9
@Override lic final int compareTo( final XClock<F> other) { LOGGER.trace("begin {}.compareTo({})", new Object[] { getClass().getSimpleName(), other }); _timeLock.lock(); try { final int rval; if (other == null) { throw new NullPointerException("can...
3433581_0
public static void loadAll() { for (AvailableFonts f : AvailableFonts.values()) { load(f); } }
3438153_0
public SCIMConfig buildConfigFromInputStream(InputStream inStream) throws CharonException { try { StAXOMBuilder omBuilder = new StAXOMBuilder(inStream); OMElement rootElement = omBuilder.getDocumentElement(); if (inStream != null) { inStream.close(); } return buil...
3438153_1
public SCIMConfig buildConfigFromInputStream(InputStream inStream) throws CharonException { try { StAXOMBuilder omBuilder = new StAXOMBuilder(inStream); OMElement rootElement = omBuilder.getDocumentElement(); if (inStream != null) { inStream.close(); } return buil...
3438153_2
public SCIMConfig buildConfigFromInputStream(InputStream inStream) throws CharonException { try { StAXOMBuilder omBuilder = new StAXOMBuilder(inStream); OMElement rootElement = omBuilder.getDocumentElement(); if (inStream != null) { inStream.close(); } return buil...
3438153_3
public SCIMConfig buildConfigFromInputStream(InputStream inStream) throws CharonException { try { StAXOMBuilder omBuilder = new StAXOMBuilder(inStream); OMElement rootElement = omBuilder.getDocumentElement(); if (inStream != null) { inStream.close(); } return buil...
3438153_4
public SCIMConfig buildConfigFromInputStream(InputStream inStream) throws CharonException { try { StAXOMBuilder omBuilder = new StAXOMBuilder(inStream); OMElement rootElement = omBuilder.getDocumentElement(); if (inStream != null) { inStream.close(); } return buil...
3438153_5
public boolean containsAll(CorrelationKeySet c) { Iterator<CorrelationKey> e = c.iterator(); while (e.hasNext()) if (!contains(e.next())) return false; return true; }
3438153_6
public List<CorrelationKeySet> findSubSets() { List<CorrelationKeySet> subSets = new ArrayList<CorrelationKeySet>(); // if the key set contains a opaque key and at least one non-opaque key, take out the opaque key CorrelationKey opaqueKey = null; boolean containsNonOpaque = false; CorrelationKeySet ...
343996_10
public ImmutableList<String> extractNames(ImmutableList<NamePart> nameParts) { nameParts.size() < 3) { throw new IllegalArgumentException("There should be at least 3 NameParts : a Country, a first-order administrative division, and a name"); urn ImmutableList.of( m1Code(nameParts), atureName(nameParts)); }
343996_11
public ImmutableList<String> extractNames(ImmutableList<NamePart> nameParts) { nameParts.size() < 3) { throw new IllegalArgumentException("There should be at least 3 NameParts : a Country, a first-order administrative division, and a name"); urn ImmutableList.of( m1Code(nameParts), atureName(nameParts)); }
343996_12
@Override public String toString() { urn new ToStringBuilder(this,ToStringStyle.SHORT_PREFIX_STYLE) ppend("name", this.name) ppend("alpha2", this.alpha2Code) ppend("alpha3", this.alpha3Code) oString(); }
343996_13
public Currency getCurrency() { return currency; }
343996_14
public FipsCountryCode getFipsCountryCode() { return fipsCountryCode; }
343996_15
public int getAdminitrativeDivisionLevel() { urn 0; }
343996_16
public AdministrativeEntity getParentAdministrativeEntity() { urn null; }
343996_17
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_18
public ImmutableList<NamePart> getFullyQualifiedNameParts() { urn ImmutableList.of(new NamePart(getName(), getFriendlyCode())); }
343996_19
@Override public int hashCode() { urn gisFeatureProvider.gisFeatureHashCode(); }
343996_20
@Override public String toString() { urn new ToStringBuilder(this,ToStringStyle.SHORT_PREFIX_STYLE) ppend("alpha2", this.iso3166Alpha2Code) ppend("alpha3", this.iso3166Alpha3Code) ppend("numeric", this.iso3166NumericCode) oString(); }
343996_21
public static CountryCodeBuilder alpha2Code(String alpha2Code) { urn new CountryCodeBuilder(alpha2Code); }
343996_22
public static CountryCodeBuilder alpha2Code(String alpha2Code) { urn new CountryCodeBuilder(alpha2Code); }
343996_23
public static CountryCodeBuilder alpha2Code(String alpha2Code) { urn new CountryCodeBuilder(alpha2Code); }
343996_24
public static CountryCodeBuilder alpha2Code(String alpha2Code) { urn new CountryCodeBuilder(alpha2Code); }
343996_25
public static CountryCodeBuilder alpha2Code(String alpha2Code) { urn new CountryCodeBuilder(alpha2Code); }
343996_26
public static City forFeature(GeonamesGisFeature gisFeature) { urn new City(new InMemoryGeonamesGisFeatureProvider(gisFeature)); }
343996_27
public static City forFeature(GeonamesGisFeature gisFeature) { urn new City(new InMemoryGeonamesGisFeatureProvider(gisFeature)); }
343996_28
public int compareTo(City o) { (o == null) { return 1; lse { return this.getName().compareTo(o.getName()); }
343996_29
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_30
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_31
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_32
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_33
public int getAdminitrativeDivisionLevel() { urn administrativeEntityLevelProvider().getAdminitrativeDivisionLevel(); }
343996_34
public Country getCountry() { urn gisFeature().getParentAdministrativeEntity().getCountry(); }
343996_35
public Currency getCurrency() { urn getCountry().getCurrency(); }
343996_36
public ImmutableList<NamePart> getFullyQualifiedNameParts() { urn gisFeature().getFullyQualifiedNameParts(); }
343996_37
public String formatName(NameFormatter nameFormatter) { urn nameFormatter.format(this); }
343996_38
public static City forGisFeatureProvider(GisFeatureProvider gisFeatureProvider) { urn new City(gisFeatureProvider); }
343996_39
public static AdministrativeDivisionBuilder administrativeDivision(String name) { urn new AdministrativeDivisionBuilder(name); }
343996_40
public static AdministrativeDivisionBuilder administrativeDivision(String name) { urn new AdministrativeDivisionBuilder(name); }
343996_41
public static AdministrativeDivisionBuilder administrativeDivision(String name) { urn new AdministrativeDivisionBuilder(name); }
343996_42
public static AdministrativeDivisionBuilder administrativeDivision(String name) { urn new AdministrativeDivisionBuilder(name); }
343996_43
public static AdministrativeDivisionBuilder administrativeDivision(String name) { urn new AdministrativeDivisionBuilder(name); }
343996_44
public static AdministrativeDivisionBuilder administrativeDivision(String name) { urn new AdministrativeDivisionBuilder(name); }
343996_45
public int getAdminitrativeDivisionLevel() { urn administrativeEntityLevelProvider().getAdminitrativeDivisionLevel(); }
343996_46
public int getAdminitrativeDivisionLevel() { urn administrativeEntityLevelProvider().getAdminitrativeDivisionLevel(); }
343996_47
public int getAdminitrativeDivisionLevel() { urn administrativeEntityLevelProvider().getAdminitrativeDivisionLevel(); }
343996_48
public int getAdminitrativeDivisionLevel() { urn administrativeEntityLevelProvider().getAdminitrativeDivisionLevel(); }
343996_49
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_50
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_51
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }
343996_52
public AdministrativeEntity getAdministrativeEntity(int level) { urn administrativeEntityLevelProvider().getAdministrativeEntity(level); }