當前位置: 首頁>>代碼示例>>Java>>正文


Java UnsupportedOperationException類代碼示例

本文整理匯總了Java中java.lang.UnsupportedOperationException的典型用法代碼示例。如果您正苦於以下問題:Java UnsupportedOperationException類的具體用法?Java UnsupportedOperationException怎麽用?Java UnsupportedOperationException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UnsupportedOperationException類屬於java.lang包,在下文中一共展示了UnsupportedOperationException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startEvent

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
public static void startEvent(String type, long startTime) throws UnsupportedOperationException {
String key = type + String.valueOf(startTime);
if (eventMap.containsKey(key)) {
    // event exists, try to start a new one
    if ((eventMap.get(key))[2] != 0) {
	// there is an unfinished event
	throw new UnsupportedOperationException();
    } else {
	(eventMap.get(key))[2] = System.currentTimeMillis();
    }
} else {
    // new event, try to create
    Long[] newTuple = new Long[3];
    newTuple[0] = (long)0;
    newTuple[1] = (long)0;
    newTuple[2] = System.currentTimeMillis();
    eventMap.put(key, newTuple);
}
System.out.println("START: " + key + "," + String.valueOf((eventMap.get(key))[0]) + "," + String.valueOf((eventMap.get(key))[1]));
   }
 
開發者ID:uraplutonium,項目名稱:teabag-ml,代碼行數:21,代碼來源:DataCollector.java

示例2: endEvent

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
public static void endEvent(String type, long startTime) throws UnsupportedOperationException {
String key = type + String.valueOf(startTime);
if (eventMap.containsKey(key)) {
    // end the event
    if ((eventMap.get(key))[2] != 0) {
	// try to finish the event
	(eventMap.get(key))[0] += 1; // counts increased by 1
	(eventMap.get(key))[1] += (System.currentTimeMillis() - (eventMap.get(key))[2]); // total time increased by the duration
	(eventMap.get(key))[2] = (long)0; // reset the time buffer
    } else {
	// the event has not been started
	throw new UnsupportedOperationException();
    }
} else {
    // the event does not exist
    throw new UnsupportedOperationException();
}
System.out.println("END:" + key + "," + String.valueOf((eventMap.get(key))[0]) + "," + String.valueOf((eventMap.get(key))[1]));
if (type.equals("score"))
    scoringCalls++;
   }
 
開發者ID:uraplutonium,項目名稱:teabag-ml,代碼行數:22,代碼來源:DataCollector.java

示例3: getDrillObjectInspector

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
public static ObjectInspector getDrillObjectInspector(DataMode mode, MinorType minorType) {
  try {
    if (mode == DataMode.REQUIRED) {
      if (OIMAP_REQUIRED.containsKey(minorType)) {
        return (ObjectInspector) OIMAP_REQUIRED.get(minorType).newInstance();
      }
    } else if (mode == DataMode.OPTIONAL) {
      if (OIMAP_OPTIONAL.containsKey(minorType)) {
        return (ObjectInspector) OIMAP_OPTIONAL.get(minorType).newInstance();
      }
    } else {
      throw new UnsupportedOperationException("Repeated types are not supported as arguement to Hive UDFs");
    }
  } catch(InstantiationException | IllegalAccessException e) {
    throw new RuntimeException("Failed to instantiate ObjectInspector", e);
  }

  throw new UnsupportedOperationException(
      String.format("Type %s[%s] not supported as arguement to Hive UDFs", minorType.toString(), mode.toString()));
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:21,代碼來源:ObjectInspectorHelper.java

示例4: getDrillType

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
public static MinorType getDrillType(ObjectInspector oi) {
  switch(oi.getCategory()) {
    case PRIMITIVE: {
      PrimitiveObjectInspector poi = (PrimitiveObjectInspector)oi;
      if (TYPE_HIVE2DRILL.containsKey(poi.getPrimitiveCategory())) {
        return TYPE_HIVE2DRILL.get(poi.getPrimitiveCategory());
      }
      throw new UnsupportedOperationException();
    }

    case MAP:
    case LIST:
    case STRUCT:
    default:
      throw new UnsupportedOperationException();
  }
}
 
開發者ID:skhalifa,項目名稱:QDrill,代碼行數:18,代碼來源:ObjectInspectorHelper.java

示例5: getMinorType

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
public static MinorType getMinorType(ObjectInspector oi) {
  switch(oi.getCategory()) {
    case PRIMITIVE: {
      PrimitiveObjectInspector poi = (PrimitiveObjectInspector)oi;
      if (TYPE_HIVE2MINOR.containsKey(poi.getPrimitiveCategory())) {
        return TYPE_HIVE2MINOR.get(poi.getPrimitiveCategory());
      }
      throw new UnsupportedOperationException();
    }

    case MAP:
    case LIST:
    case STRUCT:
    default:
      throw new UnsupportedOperationException();
  }
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:18,代碼來源:ObjectInspectorHelper.java

示例6: as

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
@Override
@SuppressWarnings("unchecked")
protected <T> T as(Class<T> returnClass) {
    if (result == null && resultJson != null) {
        result = gson.toJsonTree(resultJson);
    }
    if(metadata.getContentType() == ContentType.Void) {
        return null;
    } else if(metadata.getContentType() == ContentType.Text) {
        return gson.fromJson(new JsonPrimitive(result.getAsString()), returnClass);
    } else if(metadata.getContentType() == ContentType.Json) {
        return gson.fromJson(result, returnClass);
    } else if(metadata.getContentType() == ContentType.Binary) {
        if(byte[].class == returnClass) {
          return (T)Base64.decodeBase64(result.getAsString());
        } else {
          throw new UnsupportedOperationException("Only support returning as byte[] for Binary data");
        }

    } else {
        throw new UnsupportedOperationException("Unknown ContentType in response: " + metadata.getContentType().toString());
    }

}
 
開發者ID:algorithmiaio,項目名稱:algorithmia-java,代碼行數:25,代碼來源:AlgoSuccess.java

示例7: as

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
@Override
@SuppressWarnings("unchecked")
protected <T> T as(Class<T> returnClass) {
    if(metadata.getContentType() == ContentType.Void) {
        return null;
    } else if(metadata.getContentType() == ContentType.Text) {
        return gson.fromJson(new JsonPrimitive(result.getAsString()), returnClass);
    } else if(metadata.getContentType() == ContentType.Json) {
        return gson.fromJson(result, returnClass);
    } else if(metadata.getContentType() == ContentType.Binary) {
        if(byte[].class == returnClass) {
          return (T)Base64.decodeBase64(result.getAsString());
        } else {
          throw new UnsupportedOperationException("Only support returning as byte[] for Binary data");
        }

    } else {
        throw new UnsupportedOperationException("Unknown ContentType in response: " + metadata.getContentType().toString());
    }

}
 
開發者ID:algorithmiaio,項目名稱:algorithmia-android,代碼行數:22,代碼來源:AlgoSuccess.java

示例8: test

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
/**
 * Runs the test using the specified harness.
 *
 * @param harness  the test harness (<code>null</code> not permitted).
 */
public void test(TestHarness harness)
{
    UnsupportedOperationException object1 = new UnsupportedOperationException();
    harness.check(object1 != null);
    harness.check(object1.toString(), "java.lang.UnsupportedOperationException");

    UnsupportedOperationException object2 = new UnsupportedOperationException("nothing happens");
    harness.check(object2 != null);
    harness.check(object2.toString(), "java.lang.UnsupportedOperationException: nothing happens");

    UnsupportedOperationException object3 = new UnsupportedOperationException((String)null);
    harness.check(object3 != null);
    harness.check(object3.toString(), "java.lang.UnsupportedOperationException");

}
 
開發者ID:mozilla,項目名稱:pluotsorbet,代碼行數:21,代碼來源:constructor.java

示例9: caseASTNode

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
public void caseASTNode( ASTNode node )
{
    int numChild = node.getNumChild();
    for( int i = 0; i<numChild; i++ ){
        rewrite( node.getChild(i) );
        if( newNode != null )
            if( newNode.isSingleNode() )
                node.setChild( newNode.getSingleNode(), i );
            else{
                String msg = "Generic transformation case received non single nodes from " +
                    "transforming a child node. This should only happen when the current " +
                    "case is for a list or otherwise expects this behavior.\n"
                    +"node:\n"+node.getPrettyPrinted()
                    +"\nchild node transform:\n"+newNode.toString();
                throw new UnsupportedOperationException(msg);
            }
    }
    newNode = null;
}
 
開發者ID:sshrdp,項目名稱:mclab,代碼行數:20,代碼來源:AbstractLocalRewrite.java

示例10: revokeUserRoles

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
@Override
public void revokeUserRoles(VOUser user, List<UserRoleType> roles)
        throws ObjectNotFoundException,
        UserModificationConstraintException, UserActiveException,
        OperationNotPermittedException, UserRoleAssignmentException {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:8,代碼來源:IdentityServiceStub.java

示例11: createUser

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
@Override
public VOUserDetails createUser(VOUserDetails user,
        List<UserRoleType> roles, String marketplaceId)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:9,代碼來源:IdentityServiceStub.java

示例12: modifyUserData

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
@Override
public PlatformUser modifyUserData(PlatformUser existingUser,
        VOUserDetails tempUser, boolean modifyOwnUser, boolean sendMail)
        throws OperationNotPermittedException,
        NonUniqueBusinessKeyException, TechnicalServiceNotAliveException,
        TechnicalServiceOperationException {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:9,代碼來源:IdentityServiceStub.java

示例13: setUserRoles

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
@Override
public void setUserRoles(VOUser user, List<UserRoleType> roles)
        throws ObjectNotFoundException, OperationNotPermittedException,
        UserModificationConstraintException, UserRoleAssignmentException,
        UserActiveException {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:8,代碼來源:IdentityServiceStub.java

示例14: createUserWithGroups

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
@Override
public VOUserDetails createUserWithGroups(VOUserDetails user,
        List<UserRoleType> roles, String marketplaceId,
        Map<Long, UnitUserRole> groups)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:IdentityServiceStub.java

示例15: getProcessId

import java.lang.UnsupportedOperationException; //導入依賴的package包/類
private static Long getProcessId() {
    try {
        // Get the current process id
        return ProcessHandle.current().pid();
    } catch(UnsupportedOperationException ex) {
        return null;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:JdpController.java


注:本文中的java.lang.UnsupportedOperationException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。